Comments (2)
Thank you for the inside @dgelessus. I tried len()
and it worked but I didn't know if it was an accident or if it was designed to work. Now I know! I used it to fix beeware/toga#171.
from rubicon-objc.
You are right, there were some changes to how properties work (see #41), which means that if you want to use a property directly (without calling it like a method), you need to declare it first using ObjCClass.declare_property
.
However that's not the reason why you're getting this error, and declare_property
won't help here. count
is always a method because of #42, which added special cases to make NSArray
and NSDictionary
work like Python list
and dict
. We had a small name conflict there, because there is a count
method on Python list
and Objective-C NSArray
, but the two do different things. In the end, we decided to make count
on NSArray
s work like Python list.count
. That means to get the length of a NSArray
, you need to use len
like with a Python list, instead of the count
method.
from rubicon-objc.
Related Issues (20)
- Race condition when populating the ObjCClass method/attribute cache
- Update CI configuration to test release artefacts
- Improve correspondence between ObjectiveC objects and Python wrappers HOT 17
- New caching logic may inadvertently release objects that are still needed HOT 5
- ctypes.ArgumentError message is split into individual characters
- Warning about deprecated `pkg_resources` API
- Incompatibility with `from __future__ import annotations` HOT 1
- Incompatibility with Python 3.12.0b1 HOT 4
- Scroll blocks eventloop for ios HOT 3
- Can't invoke Protocol methods that collide with object properties HOT 2
- "ImportError: No module named 'rubicon'" if trying to bundle script via py2app. HOT 1
- Sphinx 7.2 dropped support for Python 3.8
- Importing rubicon.objs hangs on pypy HOT 1
- Normalize contribution docs with Briefcase/Toga
- Duplicate elements in repr of `ObjCInstance` HOT 7
- ctypes_patch breaks with Python 3.13.0a6 HOT 2
- Event loop stalls in network test
- Change the implementation of ObjCStrInstance HOT 2
- Partial method argument order HOT 5
- Improve the error message of partial methods HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubicon-objc.