Coder Social home page Coder Social logo

objc_hacks's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

objc_hacks's Issues

Is it posslible to gather ns objects in Python?

Could

elif isinstance(py_obj, list):   # line 481 of obj_c.py
    arr = NSMutableArray.array()
    for obj in py_obj:
    arr.addObject_(ns(obj))
    return arr

be rewritten as

elif isinstance(py_obj, list):   # line 481 of obj_c.py
    return NSMutableArray.array([ns(obj) for obj in py_obj])

If so, would it matter?

Method swizzling results in "method not found for originalSomeMethod"

Hi, I'm attempting to use the method swizzling in swizzle.py and I'm see that attempting to call the original method results in the following error (this happens with trying the test code in the main block as well as in my own test):

Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 234, in 'calling callback function'
  File "/private/var/mobile/Containers/Shared/AppGroup/74CC34ED-493E-431F-9C45-5BD2EF3B2AE0/Pythonista3/Documents/firebaseapp/swizzle.py", line 146, in saveData
  File "/var/containers/Bundle/Application/71C9338F-1BD7-4D52-9DAD-EE24DDF5139E/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 796, in __call__
    method_name, kwarg_order = resolve_instance_method(obj, self.name, args, kwargs)
  File "/var/containers/Bundle/Application/71C9338F-1BD7-4D52-9DAD-EE24DDF5139E/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 403, in resolve_instance_method
    raise AttributeError('No method found for %s' % (name,))
AttributeError: No method found for originalsaveData

Upgrade to Python 3

% flake8 . --count --select=E9,F63,F7,F82,Y --show-source --statistics

./blocktest.py:60:5: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
   print 'The item at index',ind,'is', ObjCInstance(obj)
    ^
./filter_subviews.py:22:2: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
print 'find'+'me'
 ^
./history_popup.py:55:17: F821 undefined name 'ListDataSourceList'
			self.items = ListDataSourceList([])
			             ^
./keycommands.py:18:3: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
	print 'hi'	
	 ^
./objc.py:164:13: F821 undefined name 'xrange'
   for i in xrange(num_methods.value):
            ^
./objc.py:310:39: F821 undefined name 'long'
         if not isinstance(key, (int, long)):
                                      ^
./objc.py:328:39: F821 undefined name 'long'
         if not isinstance(key, (int, long)):
                                      ^
./objc.py:345:39: F821 undefined name 'long'
         if not isinstance(key, (int, long)):
                                      ^
./objc.py:479:26: F821 undefined name 'unicode'
   if isinstance(py_obj, unicode):
                         ^
./objc.py:506:35: F821 undefined name 'basestring'
   if not isinstance(url_or_path, basestring):
                                  ^
./objcblock.py:34:8: E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
      print self, idx  , obj
       ^
./objcnew.py:233:24: F821 undefined name 'basestring'
	if isinstance(result, basestring):
	                      ^
./objcnew.py:248:25: F821 undefined name 'basestring'
		if isinstance(member, basestring):
		                      ^
./objcnew.py:345:13: F821 undefined name 'xrange'
			for i in xrange(num_methods.value):
			         ^
./objcnew.py:444:33: F821 undefined name 'long'
			if not isinstance(key, (int, long)):
			                             ^
./objcnew.py:462:33: F821 undefined name 'long'
			if not isinstance(key, (int, long)):
			                             ^
./objcnew.py:479:33: F821 undefined name 'long'
			if not isinstance(key, (int, long)):
			                             ^
./objcnew.py:506:13: F821 undefined name 'xrange'
			for i in xrange(num_methods.value):
			         ^
./objcnew.py:535:43: F821 undefined name 'basestring'
	elif typecode == ':' and isinstance(arg, basestring):
	                                         ^
./objcnew.py:721:24: F821 undefined name 'unicode'
	if isinstance(py_obj, unicode):
	                      ^
./objcnew.py:748:33: F821 undefined name 'basestring'
	if not isinstance(url_or_path, basestring):
	                               ^
./objcnew.py:837:123: F821 undefined name 'xrange'
			type_encoding = 'v%i@0:8%s' % (sizeof(c_void_p) * (num_args + 2), ''.join('@%i' % ((i+2) * sizeof(c_void_p),) for i in xrange(num_args)))
			                                                                                                                       ^
4     E999 SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
18    F821 undefined name 'ListDataSourceList'
22

Cannot convert parameter to block

If i run the script objcblock and nsblock it says in the line where you call the function: cannot convert parameter to block
I'm on ipad air 2 (64bit)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.