Giter Site home page Giter Site logo

bang590 / jspatch Goto Github PK

View Code? Open in Web Editor NEW
11.4K 11.4K 2.2K 7.71 MB

JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.

License: MIT License

Objective-C 47.07% JavaScript 1.84% Ruby 0.54% C 46.36% PHP 0.34% C++ 3.85%
hotfix jsbridge jspatch objc-runtime

jspatch's People

Contributors

albert438 avatar awhisper avatar bang590 avatar blankdlh avatar chieryw avatar daixunry avatar decemberli avatar eniton avatar fanliangbin320 avatar fighting300 avatar ipinka avatar jefferyfan avatar lancy avatar leafduo avatar lexrus avatar li6185377 avatar lihuichaoo avatar mrsummer avatar pc1849 avatar rob2468 avatar sergiou87 avatar tigerzhang08 avatar tuoxie007 avatar victorteokw avatar wenchaod avatar whihail avatar wutoz avatar xummer avatar yauzz avatar yirenjun avatar

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jspatch's Issues

include javascript modules?

Is there anyway to use javascript libraries in the included js file? something like require but for nodejs ?

Calling swizzled method that return CGPoint/CGSize/NSRange crash on the iPhone 6 simulator

Crash at this line when running on an iPhone 6 simulator.
https://github.com/bang590/JSPatch/blob/master/JSPatchDemo/JSPatchTests/JPTestObject.m#L1

The ABI is different on x86_64, we can't use _objc_msgForward_stret for these types. You can use the info returned by - [NSMethodSignature debugDescription] to figure out if a method has special struct return value.

(lldb) po methodSignature
<NSMethodSignature: 0x7fc2b400a230>
    number of arguments = 3
    frame size = 224
    is special struct return? NO
    return value: -------- -------- -------- --------
        type encoding ({) '{_NSRange=QQ}'
        flags {isStruct}
        modifiers {}
        frame {offset = 0, offset adjust = 0, size = 0, size adjust = 0}

这个是什么错误?

Process:               TestJsPatch [2232]
Path:                  /Users/USER/Library/Developer/CoreSimulator/Devices/1367F9AB-2B04-4A6C-ABE9-32EEBCB29D86/data/Containers/Bundle/Application/E0EFBF0B-55BA-4EEB-9D72-8EB6FF4E9890/TestJsPatch.app/TestJsPatch
Identifier:            TestJsPatch
Version:               1.0 (1)
Code Type:             X86-64 (Native)
Parent Process:        launchd_sim [1527]
Responsible:           launchd_sim [1527]
User ID:               501

Date/Time:             2015-08-24 15:39:13.954 +0800
OS Version:            Mac OS X 10.10.2 (14C109)
Report Version:        11
Anonymous UUID:        E479A620-D233-C75E-FDAD-61DAE5EB58C3

Sleep/Wake UUID:       919480DB-5485-4B80-B506-DD8275E21DCF

Time Awake Since Boot: 23000 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x000000000000000d

VM Regions Near 0xd:
--> 
    __TEXT                 0000000106a0e000-0000000106a3c000 [  184K] r-x/r-x SM=COW  /Users/USER/Library/Developer/CoreSimulator/Devices/1367F9AB-2B04-4A6C-ABE9-32EEBCB29D86/data/Containers/Bundle/Application/E0EFBF0B-55BA-4EEB-9D72-8EB6FF4E9890/TestJsPatch.app/TestJsPatch

Application Specific Information:
CoreSimulator 117.15 - Device: iPhone 6 - Runtime: iOS 8.3 (12F69) - DeviceType: iPhone 6

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation        0x00000001075614a9 CFRetain + 25
1   cn.toutoo.TestJsPatch           0x0000000106a201a9 JPForwardInvocation + 3449 (JPEngine.m:441)
2   com.apple.CoreFoundation        0x00000001075f9f4f ___forwarding___ + 495
3   com.apple.CoreFoundation        0x00000001075f9cd8 _CF_forwarding_prep_0 + 120
4   cn.toutoo.TestJsPatch           0x0000000106a27cf9 -[LCActionSheet didClickBtn:] + 185 (LCActionSheet.m:176)
5   com.apple.UIKit                 0x0000000108478da2 -[UIApplication sendAction:to:from:forEvent:] + 75
6   com.apple.UIKit                 0x000000010858a54a -[UIControl _sendActionsForEvents:withEvent:] + 467
7   com.apple.UIKit                 0x0000000108589919 -[UIControl touchesEnded:withEvent:] + 522
8   com.apple.UIKit                 0x00000001084c5998 -[UIWindow _sendTouchesForEvent:] + 735
9   com.apple.UIKit                 0x00000001084c62c2 -[UIWindow sendEvent:] + 682
10  com.apple.UIKit                 0x000000010848c581 -[UIApplication sendEvent:] + 246
11  com.apple.UIKit                 0x0000000108499d1c _UIApplicationHandleEventFromQueueEvent + 18265
12  com.apple.UIKit                 0x00000001084745dc _UIApplicationHandleEventQueue + 2066
13  com.apple.CoreFoundation        0x00000001075d0431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14  com.apple.CoreFoundation        0x00000001075c62fd __CFRunLoopDoSources0 + 269
15  com.apple.CoreFoundation        0x00000001075c5934 __CFRunLoopRun + 868
16  com.apple.CoreFoundation        0x00000001075c5366 CFRunLoopRunSpecific + 470
17  com.apple.GraphicsServices      0x000000010c295a3e GSEventRunModal + 161
18  com.apple.UIKit                 0x0000000108477900 UIApplicationMain + 1282
19  cn.toutoo.TestJsPatch           0x0000000106a345df main + 111 (main.m:14)
20  libdyld.dylib                   0x000000010a62d145 start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x000000010a936232 kevent64 + 10
1   libdispatch.dylib               0x000000010a5edd94 _dispatch_mgr_thread + 54

Thread 2:
0   libsystem_kernel.dylib          0x000000010a93594a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x000000010a96440d start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib          0x000000010a93594a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x000000010a96440d start_wqthread + 13

Thread 4:
0   libsystem_kernel.dylib          0x000000010a93594a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x000000010a96440d start_wqthread + 13

Thread 5:
0   libsystem_kernel.dylib          0x000000010a93594a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x000000010a96440d start_wqthread + 13

Thread 6:: JavaScriptCore::BlockFree
0   libsystem_kernel.dylib          0x000000010a935136 __psynch_cvwait + 10
1   libc++.1.dylib                  0x000000010a387475 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 47
2   JavaScriptCore                  0x0000000107cd8f33 JSC::BlockAllocator::blockFreeingThreadMain() + 243
3   JavaScriptCore                  0x000000010818be13 WTF::wtfThreadEntryPoint(void*) + 19
4   libsystem_pthread.dylib         0x000000010a966268 _pthread_body + 131
5   libsystem_pthread.dylib         0x000000010a9661e5 _pthread_start + 176
6   libsystem_pthread.dylib         0x000000010a96441d thread_start + 13

Thread 7:: JavaScriptCore::Marking
0   libsystem_kernel.dylib          0x000000010a935136 __psynch_cvwait + 10
1   libc++.1.dylib                  0x000000010a387475 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 47
2   JavaScriptCore                  0x0000000107e7139b JSC::GCThread::waitForNextPhase() + 171
3   JavaScriptCore                  0x0000000107e71448 JSC::GCThread::gcThreadMain() + 72
4   JavaScriptCore                  0x000000010818be13 WTF::wtfThreadEntryPoint(void*) + 19
5   libsystem_pthread.dylib         0x000000010a966268 _pthread_body + 131
6   libsystem_pthread.dylib         0x000000010a9661e5 _pthread_start + 176
7   libsystem_pthread.dylib         0x000000010a96441d thread_start + 13

Thread 8:: JavaScriptCore::Marking
0   libsystem_kernel.dylib          0x000000010a935136 __psynch_cvwait + 10
1   libc++.1.dylib                  0x000000010a387475 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 47
2   JavaScriptCore                  0x0000000107e7139b JSC::GCThread::waitForNextPhase() + 171
3   JavaScriptCore                  0x0000000107e71448 JSC::GCThread::gcThreadMain() + 72
4   JavaScriptCore                  0x000000010818be13 WTF::wtfThreadEntryPoint(void*) + 19
5   libsystem_pthread.dylib         0x000000010a966268 _pthread_body + 131
6   libsystem_pthread.dylib         0x000000010a9661e5 _pthread_start + 176
7   libsystem_pthread.dylib         0x000000010a96441d thread_start + 13

Thread 9:: JavaScriptCore::Marking
0   libsystem_kernel.dylib          0x000000010a935136 __psynch_cvwait + 10
1   libc++.1.dylib                  0x000000010a387475 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 47
2   JavaScriptCore                  0x0000000107e7139b JSC::GCThread::waitForNextPhase() + 171
3   JavaScriptCore                  0x0000000107e71448 JSC::GCThread::gcThreadMain() + 72
4   JavaScriptCore                  0x000000010818be13 WTF::wtfThreadEntryPoint(void*) + 19
5   libsystem_pthread.dylib         0x000000010a966268 _pthread_body + 131
6   libsystem_pthread.dylib         0x000000010a9661e5 _pthread_start + 176
7   libsystem_pthread.dylib         0x000000010a96441d thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x00007f89d04603c0  rbx: 0x0000000000000005  rcx: 0x00007f89d04603c0  rdx: 0x000000000000001f
  rdi: 0x0000000000000005  rsi: 0x00000001113bce00  rbp: 0x00007fff591ed750  rsp: 0x00007fff591ed740
   r8: 0x0000000000000005   r9: 0x00007f89d0400000  r10: 0x0000000000000040  r11: 0x00007f89d0400000
  r12: 0x00007f89d04528d0  r13: 0x00007f89d04527c0  r14: 0x00007f89d0724dd0  r15: 0x00007fff591ee600
  rip: 0x00000001075614a9  rfl: 0x0000000000010206  cr2: 0x000000000000000d

Logical CPU:     2
Error Code:      0x00000004
Trap Number:     14


Binary Images:
       0x106a0e000 -        0x106a3bfff +cn.toutoo.TestJsPatch (1.0 - 1) <5C267FDD-0E75-3C79-9DAC-F8D257C3AD27> /Users/USER/Library/Developer/CoreSimulator/Devices/1367F9AB-2B04-4A6C-ABE9-32EEBCB29D86/data/Containers/Bundle/Application/E0EFBF0B-55BA-4EEB-9D72-8EB6FF4E9890/TestJsPatch.app/TestJsPatch
       0x106a64000 -        0x106a8877f +dyld_sim (353.2.1) <C4C4D1A2-E19B-33BE-A569-EFBD99B392C7> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/dyld_sim
       0x106ace000 -        0x106d9bff7  com.apple.Foundation (6.9 - 1144.17) <9100ED65-5076-380D-B135-1D405B6E48B8> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Foundation.framework/Foundation
       0x106f74000 -        0x10716c74f +libobjc.A.dylib (647.1) <E2D8BBF9-2E91-324C-BFB9-873404DB2E9A> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libobjc.A.dylib
       0x107190000 -        0x107197fff +libSystem.dylib (1214.5.1) <E20E6F02-EC06-3A55-900F-B86DAC634FEC> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libSystem.dylib
       0x10719f000 -        0x10742efff +CoreData (519.15) <781AF177-881F-36CD-B4B2-C3E5E6DC4F68> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreData.framework/CoreData
       0x10755b000 -        0x1078ffff7  com.apple.CoreFoundation (6.9 - 1144.17) <D53DB557-353E-3014-87C7-0E129BBE917E> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
       0x107a79000 -        0x107c44fff  com.apple.CoreGraphics (1.600.0 - 747.2.1) <E3C5DB77-6F48-3FB5-8256-4F589ECC9768> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
       0x107cbb000 -        0x1082d9fff +JavaScriptCore (7600.1.4.15.12) <04AB8E88-E215-3D5E-996D-B0C20D487324> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore
       0x10845b000 -        0x108fccfff  com.apple.UIKit (1.0 - 1000) <E0335856-5109-39B6-A7C8-CECC83482651> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/UIKit.framework/UIKit
       0x10973e000 -        0x10981afff  com.apple.MobileCoreServices (66 - 66) <7AB7B0EA-05AD-32C2-A5B6-DD245276B942> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
       0x109891000 -        0x1098b4fff +libextension.dylib (51.5) <916144FE-E244-3B28-8C02-4EF2F789E885> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libextension.dylib
       0x1098d4000 -        0x109906fff +libarchive.2.dylib (30) <E792D478-8CF5-3E28-93D3-FF40F979EBF7> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libarchive.2.dylib
       0x109910000 -        0x109b46fff +libicucore.A.dylib (531.27.29) <ABA196E4-4345-3E63-B4E3-6447B2A05EBF> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libicucore.A.dylib
       0x109c00000 -        0x109d0dfff +libxml2.2.dylib (25.6) <1D515EF4-5813-31E9-A2E1-F9CC44F77E2A> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libxml2.2.dylib
       0x109d44000 -        0x109d56fff +libz.1.dylib (55) <C06AFD8F-7461-35FD-94B9-8261CB0CFC17> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libz.1.dylib
       0x109d5b000 -        0x109feefff  com.apple.CFNetwork (711.3.18 - 711.3.18) <3C852320-6065-3143-AFE5-D550621B5CF4> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CFNetwork.framework/CFNetwork
       0x10a172000 -        0x10a1d5fff  com.apple.SystemConfiguration (1.14 - 1.14) <9C6F5F22-B9C9-3363-8F7B-FAAB52BD5000> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
       0x10a20a000 -        0x10a272ff7  com.apple.Security (10.0 - ???) <2BB6A432-A6CE-399D-91B9-7BC0C854BDE8> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Security.framework/Security
       0x10a2b5000 -        0x10a31dff7  com.apple.framework.IOKit (2.0.2 - 1051.20.5) <12F1FD5C-860E-3FC3-A379-17B5C46B9496> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
       0x10a34f000 -        0x10a370ff7 +libCRFSuite.dylib (32) <5891DEF8-AF5C-3B80-BF12-26770F52B61C> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libCRFSuite.dylib
       0x10a37b000 -        0x10a37cfff +liblangid.dylib (114) <70885611-7105-35A6-AF82-4C96A30D3548> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/liblangid.dylib
       0x10a380000 -        0x10a3ebfff +libc++.1.dylib (235.1) <16BB9B75-0D3D-3BF7-8108-D7536137D703> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libc++.1.dylib
       0x10a440000 -        0x10a45bff7 +libMobileGestalt.dylib (297.20.3) <9F5C783B-B26C-3828-8786-5D90FA22DBBC> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libMobileGestalt.dylib
       0x10a48b000 -        0x10a49dff7 +libbsm.0.dylib (28.1) <84FE53F3-82AE-3E0F-B55F-AA904F75A1E9> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libbsm.0.dylib
       0x10a4a6000 -        0x10a4d3fff +libc++abi.dylib (126.2) <D43D5CB7-ED00-32B8-AF65-D5E00A9FE467> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libc++abi.dylib
       0x10a4e1000 -        0x10a4e6ff7 +libcache_sim.dylib (69) <9BD08341-65F7-3CEC-8413-7A61D90833B3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libcache_sim.dylib
       0x10a4eb000 -        0x10a4fafff +libcommonCrypto.dylib (60061) <342DE493-A7A3-31C2-918D-966C0C3384EC> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libcommonCrypto.dylib
       0x10a508000 -        0x10a50ffff +libcompiler_rt.dylib (60.3) <E01711E6-B37F-3839-BF39-5F75967F9A27> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libcompiler_rt.dylib
       0x10a518000 -        0x10a520ff7 +libcopyfile.dylib (119.1.1) <2DBDA579-F3BE-3E52-9E66-7C8660F3B53B> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libcopyfile.dylib
       0x10a526000 -        0x10a5a5fe7 +libcorecrypto.dylib (235.10.8) <D10C2194-29C3-3395-936D-9F524BF04276> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libcorecrypto.dylib
       0x10a5e1000 -        0x10a609ff7 +libdispatch.dylib (443.5.5) <E972D21E-E418-3A68-9586-0A52EE868FD3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libdispatch.dylib
       0x10a62b000 -        0x10a62dff7 +libdyld.dylib (353.12) <F4D69A44-78F4-3035-895F-C767F1FC7FEF> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libdyld.dylib
       0x10a633000 -        0x10a633ff7 +liblaunch.dylib (560.20.11) <5CC7852C-28B4-3A25-A735-EDD98EAE74B3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/liblaunch.dylib
       0x10a639000 -        0x10a63ffff +libmacho_sim.dylib (857) <ECA6E5E8-B403-3E22-BFCE-846B2E3318C2> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libmacho_sim.dylib
       0x10a645000 -        0x10a647fff +libremovefile.dylib (35) <1C2E631C-E0B5-312A-B769-7789E22F3BE1> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libremovefile.dylib
       0x10a64c000 -        0x10a665ff7 +libsystem_asl.dylib (267.20.1) <E7F2F474-09F9-3A2C-88FB-DDCCF761A018> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_asl.dylib
       0x10a672000 -        0x10a673fff +libsystem_sim_blocks.dylib (65) <8B37F561-3736-3487-8E94-0B1670426DD7> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_blocks.dylib
       0x10a678000 -        0x10a714fff +libsystem_sim_c.dylib (1046) <B08A213E-9D29-3E38-BF1D-9C26B8239160> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_c.dylib
       0x10a73e000 -        0x10a741fff +libsystem_sim_configuration.dylib (700.20.6) <F9B991BD-9C3D-3B29-82BE-CCDA0D3C66C7> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_configuration.dylib
       0x10a747000 -        0x10a748fff +libsystem_coreservices.dylib (7) <EEC8A166-FEB0-3AB0-90ED-FFA75DB91BD3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_coreservices.dylib
       0x10a74d000 -        0x10a762ff7 +libsystem_coretls.dylib (36.20.3) <9A77131E-937A-3EF5-9099-4C52AA3CBA19> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_coretls.dylib
       0x10a773000 -        0x10a77cff7 +libsystem_sim_dnssd.dylib (562.20.1) <DE8451BF-610C-3B7E-80BD-C42917201ADF> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_dnssd.dylib
       0x10a782000 -        0x10a7aefff +libsystem_sim_info.dylib (459.5.2) <A361F51A-783C-373A-8551-878209BA8793> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_info.dylib
       0x10a7c0000 -        0x10a7c4ff7 +libsystem_sim_kernel.dylib (141.20.1) <D7A14FE6-DB17-3136-B0E7-0DC822E7E405> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_kernel.dylib
       0x10a7ca000 -        0x10a7fbfe7 +libsystem_sim_m.dylib (3086.1) <1032D0C4-4704-382D-813C-90D6D5F81D3D> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_m.dylib
       0x10a802000 -        0x10a820fff +libsystem_malloc.dylib (55.3.1) <6E5C1529-DA77-30E3-BC6C-3B18CA373E88> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_malloc.dylib
       0x10a829000 -        0x10a86aff7 +libsystem_network.dylib (413.20.6) <8F786BB5-92F2-30B1-B529-A60F45E23E88> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_network.dylib
       0x10a88f000 -        0x10a89afff +libsystem_notify.dylib (134.5.1) <86656D9D-D6B8-3183-B964-9D9FF0C69CAE> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_notify.dylib
       0x10a8a2000 -        0x10a8a5ff7 +libsystem_sim_platform.dylib (141.20.1) <AF406E19-0199-3838-A251-B0379C775A69> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_platform.dylib
       0x10a8aa000 -        0x10a8abfff +libsystem_sim_pthread.dylib (141.20.1) <3C530E1A-60A5-3D23-BDA6-4EB4B7C8458C> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_pthread.dylib
       0x10a8b1000 -        0x10a8b4fff +libsystem_sim_sandbox.dylib (359.20.1) <43A4CD4E-88D4-3CC5-86BB-7EC4708A17DC> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_sandbox.dylib
       0x10a8ba000 -        0x10a8c1ff7 +libsystem_sim_trace.dylib (73.20.1) <C3DA37C7-DE07-3A7D-98E4-FB603EAC04CA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libsystem_sim_trace.dylib
       0x10a8ca000 -        0x10a8d0ff7 +libunwind_sim.dylib (126.2) <50BD947B-0ABE-3BDF-A7EC-E424F48D52F1> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libunwind_sim.dylib
       0x10a8d7000 -        0x10a903ff7 +libxpc.dylib (560.20.11) <23DBFC52-1ABE-3A33-8FE2-637C3B0EA394> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/libxpc.dylib
       0x10a91f000 -        0x10a93cfff  libsystem_kernel.dylib (2782.10.72) <97CD7ACD-EA0C-3434-BEFC-FCD013D6BB73> /usr/lib/system/libsystem_kernel.dylib
       0x10a952000 -        0x10a95afff  libsystem_platform.dylib (63) <64E34079-D712-3D66-9CE2-418624A5C040> /usr/lib/system/libsystem_platform.dylib
       0x10a963000 -        0x10a96cfff  libsystem_pthread.dylib (105.10.1) <3103AA7F-3BAE-3673-9649-47FFD7E15C97> /usr/lib/system/libsystem_pthread.dylib
       0x10a978000 -        0x10aa70ff7 +libsqlite3.dylib (169.2) <A1DE8EEE-FB3A-3B52-AC90-FB69FAA1BAE3> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libsqlite3.dylib
       0x10aa89000 -        0x10aa96fff +libbz2.1.0.dylib (36) <70EA3E5E-CA0F-3BBD-9530-3D6FB212744F> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libbz2.1.0.dylib
       0x10aa9b000 -        0x10aab8ff7 +liblzma.5.dylib (7.5.1) <133480FA-3A7F-3FC0-B5DD-6EA9D757939E> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/liblzma.5.dylib
       0x10aac0000 -        0x10aac0fff  com.apple.Accelerate (1.10 - Accelerate 1.10) <51BE3B03-4495-3585-A1FF-610AFB909D28> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Accelerate
       0x10aac3000 -        0x10af41fe7  com.apple.vImage (8.0 - 8.0) <F5BCA4F0-5C3A-3E53-9BF3-43A4A2A27EFA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage
       0x10af9b000 -        0x10af9bfff  com.apple.Accelerate.vecLib (3.10 - vecLib 3.10) <B2EF22D7-7084-3B50-878F-BF3AB23F0BEA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
       0x10af9e000 -        0x10b0b2fff +libvDSP.dylib (514) <D8031E99-F650-3FF2-8E58-93E19C770C4A> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
       0x10b0be000 -        0x10b4e9ff7 +libLAPACK.dylib (1128) <922D9DA5-A8A2-3EE7-90D9-7A354BA168E7> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
       0x10b51d000 -        0x10b6b5fff +libBLAS.dylib (1128) <3E15CBF7-68CB-3277-A1A2-F703546A2092> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
       0x10b6d2000 -        0x10b77dfff +libvMisc.dylib (514) <D24D01B6-6AB6-31D2-9021-69DA6596337D> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvMisc.dylib
       0x10b786000 -        0x10b79ffff +libLinearAlgebra.dylib (1128) <C09601AB-330B-3A5A-8FA2-E2D558E54EFD> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLinearAlgebra.dylib
       0x10b7a7000 -        0x10b89dff7  com.apple.UIFoundation (1.0 - 1) <1E76B3DA-BEE7-3582-9A97-154C311F9D61> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation
       0x10b911000 -        0x10b93bfff  com.apple.FrontBoardServices (1.0 - 1) <FC1F215F-F755-3491-84E8-6DB92118AE7D> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices
       0x10b967000 -        0x10b9b4fff  com.apple.BaseBoard (1.0 - 1) <4FCAFDBB-C9C5-3ABB-A77A-645CF198676E> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard
       0x10b9f9000 -        0x10baa8ff7  com.apple.CoreUI (1.0 - 307.2) <F5161B3C-1D04-3164-BB9F-67D72115093C> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CoreUI.framework/CoreUI
       0x10bb7e000 -        0x10bb9bfff  com.apple.CoreVideo (1.8 - 144.14) <C73400D5-5F7D-358A-8246-D4411A40FDC5> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreVideo.framework/CoreVideo
       0x10bbaf000 -        0x10bbc0fff  com.apple.opengles (12.0.5 - 12.0.5) <60808528-172D-38A6-923C-C92E180780C6> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/OpenGLES
       0x10bbcc000 -        0x10bed1ff7  com.apple.VideoToolbox (1.0 - 1561.128) <70773031-DBF8-34DF-A1F8-CECCD6BA2AEA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/VideoToolbox.framework/VideoToolbox
       0x10bf54000 -        0x10bf64fff  com.apple.MobileAssets (1.0 - 1) <61C5F18A-1281-3CC5-9B12-530AD66F9C33> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/MobileAsset.framework/MobileAsset
       0x10bf73000 -        0x10bf97ff7  com.apple.BackBoardServices (1.0 - 1.0) <99CC0D50-1A1F-337B-B78F-A905081ECCEF> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/BackBoardServices.framework/BackBoardServices
       0x10bfbe000 -        0x10c138ff7  com.apple.CoreImage (8.3 - 289) <8217DFF1-FEAF-327F-B545-C5942A2F41F0> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreImage.framework/CoreImage
       0x10c243000 -        0x10c26afff  com.apple.DictionaryServices (1.2 - ???) <80BFBE7C-FEFE-381F-B233-E779802A9C6F> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServices
       0x10c289000 -        0x10c2a0ff7  com.apple.GraphicsServices (1.0 - 1.0) <CE0ABDAF-6C80-3978-8BDA-CE556398B2B9> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
       0x10c2b7000 -        0x10c5b8fff  com.apple.ImageIO.framework (3.3.0 - 1161) <E2A5798F-9B14-33F9-8E3C-0C8473872F80> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/ImageIO.framework/ImageIO
       0x10c65a000 -        0x10c812ff7  com.apple.QuartzCore (1.11 - 367.1) <98AB28B2-4141-3D89-BB48-BB8FCBE497B6> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore
       0x10c8cd000 -        0x10c8f1fff  com.apple.SpringBoardServices (1.0 - 1.0) <AEFE5754-D4E2-373A-ACFC-6B1A9A5E22AA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
       0x10c913000 -        0x10c966fff  com.apple.AppSupport (1.0.0 - 29) <BDE0D5BF-587F-303A-B08F-69C7B8C01E5E> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
       0x10c9a2000 -        0x10cb09ff7  com.apple.CoreText (352.0 - 451.6.9) <9F804CDC-42E2-32D8-85C6-509CACE26B58> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreText.framework/CoreText
       0x10cba7000 -        0x10cbddfff  com.apple.TextInput (1.0) <063E4711-CAE3-3506-89F2-DCA85B5D7FFE> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/TextInput.framework/TextInput
       0x10cc18000 -        0x10cd21ff7  com.apple.WebKitLegacy (8600 - 8600.1.4.15.16) <E475A630-637F-3DDC-9D25-2FA9FAB64F9E> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy
       0x10cde2000 -        0x10e58bff7  com.apple.WebCore (8600 - 8600.1.4.15.15) <19F985D1-170E-3DCC-810D-5CC6C2916B76> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/WebCore.framework/WebCore
       0x10ef56000 -        0x10f033ff7  com.apple.ProofReader (2.2.3 - 282) <CC37EC9C-053C-3EC8-94DC-48947F2C1720> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
       0x10f065000 -        0x10f072fff +libAccessibility.dylib (1541.64.30) <33A720B9-17A1-36BE-B366-C3770BADEAA8> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libAccessibility.dylib
       0x10f083000 -        0x10f0e7fff  com.apple.PhysicsKit (1.0 - 1) <18D20741-27F0-3E1D-B14B-04EA20ECAC82> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhysicsKit.framework/PhysicsKit
       0x10f114000 -        0x10f114fff  com.apple.FontServices (1.0 - 1) <9A35B2A3-EEFB-3634-B611-D08A5309CA16> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/FontServices.framework/FontServices
       0x10f118000 -        0x10f212fff +libFontParser.dylib (129.5.4) <A8F26E73-42A4-3B3C-BE34-D5D596290ECA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/FontServices.framework/libFontParser.dylib
       0x10f2c8000 -        0x10f36d87f  com.apple.AppleJPEG (1.0 - 1) <C3BA4DD1-3253-3CF5-8E60-B7B1A1C2FD90> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AppleJPEG.framework/AppleJPEG
       0x10f3d3000 -        0x10f3defff +libGFXShared.dylib (12.0.5.6) <03F7FDFF-991E-30A7-9693-B2CDC71BAF53> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
       0x10f3e5000 -        0x10f42dff7 +libGLImage.dylib (12.0.5.6) <81CFE3E4-BFE7-3FBD-A43B-1EB4393F02C5> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
       0x10f436000 -        0x10f438fff +libCVMSPluginSupport.dylib (12.0.5.6) <522EE7AA-8DB1-3F04-BFF8-71C3EEE986B0> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/libCVMSPluginSupport.dylib
       0x10f43e000 -        0x10f44aff7 +libCoreVMClient.dylib (93.2) <7055BDFF-AFEA-35BA-ACAB-E8E47529AB3E> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/libCoreVMClient.dylib
       0x10f454000 -        0x1101e3fc7 +libLLVMContainer.dylib (93.2) <A45C73B5-6BBC-330A-9E52-DF1BC2BC2FF4> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/libLLVMContainer.dylib
       0x11052f000 -        0x11053eff7  com.apple.AssertionServices (1.0 - 1) <30E9AE5B-4AC8-3DE3-AA38-FCD571DD9B42> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices
       0x110551000 -        0x110993fff  com.apple.vision.FaceCore (3.1.6 - 3.1.6) <9FBEFD9F-AB04-3D87-A795-A722A689E510> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/FaceCore.framework/FaceCore
       0x110bab000 -        0x110d20ff7 +libFosl_dynamic.dylib (15.11) <FE10EB4E-331A-3E64-9691-747C08EDA021> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libFosl_dynamic.dylib
       0x110da2000 -        0x110e14ff7  com.apple.CoreMedia (1.0 - 1561.128) <E74E08B2-871E-3FD1-B12E-37BAF6BA04EA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreMedia.framework/CoreMedia
       0x110e6c000 -        0x110e6dff7  com.apple.iphonesimulator.SimulatorClient (1.0 - 1) <163DF00D-4C4D-3076-B84B-AD1AA0482861> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/SimulatorClient.framework/SimulatorClient
       0x110e72000 -        0x110ecdff7  com.apple.audio.CoreAudio (4.3.0 - 4.3.0) <E5716F73-98F4-3692-BE30-E0AE379316F5> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreAudio.framework/CoreAudio
       0x110ef1000 -        0x110f1eff7 +libxslt.1.dylib (13) <4FE91C9A-8B89-378C-8715-73AD0A0BD066> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libxslt.1.dylib
       0x110f2b000 -        0x111211ff7  com.apple.audio.toolbox.AudioToolbox (1.8 - 1.8) <1D087696-4449-3117-A821-685E517F70C6> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
       0x111308000 -        0x11130dff7  com.apple.TCC (1.0 - 1) <0DA785F4-6119-3801-9748-1B6BAE18BC77> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/TCC.framework/TCC
       0x111314000 -        0x111364fff  com.apple.LanguageModeling (1.0 - 1) <E70649A3-47EF-30A3-80F7-EB2ABEFA0C99> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/LanguageModeling.framework/LanguageModeling
       0x111375000 -        0x11137afff  com.apple.AggregateDictionary (1.0 - 1) <5E75F76E-4FAA-3D29-9A12-C9082000100A> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
       0x111381000 -        0x111395fff +libcmph.dylib (4) <B1581C7E-A5DD-3954-AA82-2CF1B5379884> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libcmph.dylib
       0x1113a4000 -        0x1113acfff  com.apple.MediaAccessibility (1.0 - 75) <5C844E24-B602-311B-8862-B1E42E418625> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/MediaAccessibility.framework/MediaAccessibility
       0x1116cc000 -        0x1116d2fff  com.apple.ConstantClasses (1.0 - 1) <87731EA6-5E59-308E-91F0-7CE3574EB2BA> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/ConstantClasses.framework/ConstantClasses
       0x1116db000 -        0x1116defff +libCGXType.A.dylib (747.2.1) <4EE373C7-4A02-3C42-AE2D-B31265A4C327> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libCGXType.A.dylib
       0x1117a5000 -        0x1117cefff +libRIP.A.dylib (747.2.1) <C9E74F2C-E6F7-3690-B927-78F6CFAA28E9> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
       0x1117dd000 -        0x1117ecff7 +libCMSBuiltin.A.dylib (747.2.1) <25CC2204-B422-3D1D-BBAF-7E8511D4984A> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libCMSBuiltin.A.dylib
       0x113923000 -        0x113932fff +libGSFontCache.dylib (20.4.7) <2E37ACCD-FD9F-3DD8-9853-36BFEDF84E4F> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/FontServices.framework/libGSFontCache.dylib
       0x114052000 -        0x1140a8ff7  com.apple.ColorSync (3.0 - 3) <989B13A0-B12C-3748-A8B3-6EB36DF77380> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/ColorSync.framework/ColorSync
    0x7fff65711000 -     0x7fff65747837  dyld (353.2.1) <65DCCB06-339C-3E25-9702-600A28291D0E> /usr/lib/dyld

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 10318
    thread_create: 0
    thread_set_state: 5556

VM Region Summary:
ReadOnly portion of Libraries: Total=156.2M resident=70.5M(45%) swapped_out_or_unallocated=85.7M(55%)
Writable regions: Total=1.1G written=11.7M(1%) resident=13.6M(1%) swapped_out=0K(0%) unallocated=1.1G(99%)

REGION TYPE                      VIRTUAL
===========                      =======
CoreAnimation                       500K
CoreServices                        684K
Dispatch continuations             8192K
Image IO                             28K
JS JIT generated code               1.0G
JS garbage collector               1280K
Kernel Alloc Once                     8K
MALLOC                             38.4M
MALLOC (admin)                       32K
STACK GUARD                        56.0M
Stack                              12.1M
VM_ALLOCATE                          60K
WebKit Malloc                      1032K
__DATA                             15.8M
__LINKEDIT                         33.2M
__TEXT                            123.0M
__UNICODE                           552K
mapped file                        53.0M
shared memory                         4K
===========                      =======
TOTAL                               1.3G


dealloc not called

I ran this demo, JPTableViewController can not be dealloced after it has been push in the stack.
What caused this problem?

为什么我在项目中集成JSPatch总是crash?

我想在项目中集成了JSPatch 但是总是报 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'js exception,
msg: Can't find variable: require

郁闷的是在同样的JS文件在DEMO中可以正常加载,但是一合到我们的实际工程中就是报错。
这个错误什么原因导致的呢?

block 作为参数JS如何定义?

OC:
typedef void (^WVJBResponseCallback)(id responseData);

[_bridge registerHandler:@"logOut" handler:^(id data, WVJBResponseCallback responseCallback) {
[[LoginManager sharedInstance] logout];
responseCallback(@{@"status":@"1", @"respData":@{@"test":@"test"}});
}];

JS:
self.bridge().registerHandler_handler("logOut", block("id, WVJBResponseCallback", function(data, responseCallback){
console.log("回调成功")
}))

以上这样写回调不成功....

添加方法

在js脚本怎么添加新方法去执行代码

当js文件不存在会导致奔溃

当我修改代码:demo ---> demo1.js是不存在的

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    NSString sourcePath = [[NSBundle mainBundle] pathForResource:@"demo1" ofType:@"js"];
    NSString *script = [NSString stringWithContentsOfFile:sourcePath encoding:NSUTF8StringEncoding error:nil];
    [JPEngine evaluateScript:script];
    ...........
    }
    2015-06-09 09:17:22.985 JSPatchDemo[8170:315296] *
    * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSRegularExpression enumerateMatchesInString:options:range:usingBlock:]: nil argument'
    *** First throw call stack:
    所以我认为加一个判断 sourcePath == nil 时候不执行 [JPEngine evaluateScript:script];

when i

Hi,when I code a demo like this , but it will crash when i click button and did not called alertView_willDismissWithButtonIndex method .

qq20150616-1 2x

crash:

qq20150616-1 2x

Block with return value

As we know, we can use block like this:

// Obj-C
@implementation JPObject
+ (void)request:(void(^)(NSString *content, BOOL success))callback
{
  callback(@"I'm content", YES);
}
@end

// JS
require('JPObject').request(block("NSString *, BOOL", function(ctn, succ) {
  if (succ) log(ctn)  //output: I'm content
}))

But If the block have return value

typedef NSString *(^CellReuseIdentifierForRowAtIndexPath)(NSIndexPath *indexPath);

What should I do?
I use this way get crash:

var identiferBlk = block("NSIndexPath *", function(indexPath) {
    return "CellIdentifier";
});

最新崩溃问题

如何调用普通的全局变量?不是property生成的,现在是找不到全局变量

继承父类的类方法不能被调用

我项目里集成了JSONModel,我用JSPatch重新写了JSONModel的+ (JSONKeyMapper *)keyMapper
这个键映射方法,但是不能被调用
require('NSMutableDictionary, JSONKeyMapper')
defineClass('KeysModel',{
keyMapper :function(){
var add = NSMutableDictionary.alloc().init();
add.setObject_forKey('qqAppId','qqAppId');
var dict = JSONKeyMapper.alloc().initWithDictionary(ddd);

webview

webview load html by jspatch has issue

关于Hot fix

如果我想用这个库来实现动态更新,具体应该怎么实施呢?
我的想法是,启动前拉一次请求,是否需要热更新,然后下载js,最后start engine。

不知道这样是否可行,求给个建议吧。万分感谢

Can not install Submodule "Extensions"

The cocoapods Error Info:

[!] Unable to satisfy the following requirements:
- `JSPatch/Extensions` required by `Podfile`

My Podfile like this:

pod 'JSPatch'
pod 'JSPatch/Extensions'

Please help me!

What's the best way to clear context after running `evaluateScript`?

I want to use JSPatch to apply hotfix. So my problem is that when the app start, it will run startEngine and evaluateScript.

After downloading the hotfix, I need to reload the hotfix js scripts without previous definitions.

I did a quick test and it seems that run evaluateScript again didn't clean previous script context.

What's the best way to do this? Thanks.

It seem's JSPatch can only support DISPATCH_QUEUE_SERIAL dispatch_queue

Scene I
I tried to create a DISPATCH_QUEUE_CONCURRENT dispatch_queue, multi tasks in the dispatch_queue share one JSContext, then a got a exception with message "TypeError: undefined is not an object (evaluating 'self.__c')"

Scene II
I tried to create a DISPATCH_QUEUE_SERIAL dispatch_queue. when the background tasks were running, I click a button to call another patched method. The exception above occurred, too.

The test code is in my fork branch
https://github.com/Robert-Qiu/JSPatch/tree/multitherad_test

强制类型转换

你好,我在JS中拿到OC 的 NSNumber 类型,在进行 NSNumber -->NSString的转换中,该怎么转换?
在 tableView_cellForRowAtIndexPath 方法中:
num 是一个在 OC 中的 NSNumber 对象。
var num = self.dataSource()[indexPath.row].sringValue();
cell.textLabel().setText(num +"js");
报错:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'js exception: TypeError: undefined is not an object (evaluating 'num.__c')'。
js的强制转换 String(value),不起作用。

dealloc 调用会延迟... 能优化成立即释放吗?

2015-07-29 11:39:07.175 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:08.085 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:11.402 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:12.305 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:13.067 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:15.535 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:16.305 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:17.117 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:19.718 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:20.507 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:22.051 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:23.167 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:23.968 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:25.534 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:27.151 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:28.518 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:29.151 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:30.717 licaishi[12659:60b] [WebViewController viewDidLoad 130]:
2015-07-29 11:39:31.917 licaishi[12659:60b] [WebViewController viewDidLoad 130]:

停止操作, 静态2分钟左右, 系统自动会调用 dealloc

2015-07-29 11:41:20.993 licaishi[12659:60b] [WebViewController dealloc 135]:
2015-07-29 11:41:20.995 licaishi[12659:60b] [WebViewJavascriptBridge dealloc 94]:
2015-07-29 11:41:20.997 licaishi[12659:60b] [WebViewController dealloc 135]:
2015-07-29 11:41:20.998 licaishi[12659:60b] [WebViewJavascriptBridge dealloc 94]:
2015-07-29 11:41:20.999 licaishi[12659:60b] [WebViewController dealloc 135]:
2015-07-29 11:41:20.999 licaishi[12659:60b] [WebViewJavascriptBridge dealloc 94]:
2015-07-29 11:41:21.000 licaishi[12659:60b] [WebViewController dealloc 135]:
2015-07-29 11:41:21.001 licaishi[12659:60b] [WebViewJavascriptBridge dealloc 94]:
2015-07-29 11:41:21.002 licaishi[12659:60b] [WebViewController dealloc 135]:
2015-07-29 11:41:21.002 licaishi[12659:60b] [WebViewJavascriptBridge dealloc 94]:
2015-07-29 11:41:21.003 licaishi[12659:60b] [WebViewController dealloc 135]:

问题是 如果操作不停止, 就会一直创建新的控制器, 导致内存警告

能优化成立即释放吗? 比如 navigationController pop 对应控制器的时候.

类方法不被调用

我项目里面继承了JSONModel ,我用jsPatch重写了+ (JSONKeyMapper *)keyMapper这个键映射的方法,不能被调用是为什么

UIAlertView crash

var alertView = require('UIAlertView').alloc().initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles("Alert",self.dataSource().objectAtIndex(indexPath.row()), self, "OK", "other");
alertView.show()

BT is:

  • thread #1: tid = 0x1cefa, 0x005b30b2 libobjc.A.dylibobjc_msgSend + 14, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc03102f7) frame #0: 0x005b30b2 libobjc.A.dylibobjc_msgSend + 14
    frame #1: 0x007c5f9e CoreFoundationCFRetain + 110 frame #2: 0x007cdafc CoreFoundation-[NSArrayM insertObject:atIndex:] + 620
    frame #3: 0x007cd861 CoreFoundation-[__NSArrayM addObject:] + 65 frame #4: 0x016f8a43 UIKit-[UIAlertView addButtonWithTitle:] + 195
    frame #5: 0x016f7a44 UIKit-[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:] + 258 frame #6: 0x007f976d CoreFoundation_invoking
    + 29
    frame #7: 0x007f9618 CoreFoundation`-[NSInvocation invoke] + 360
    • frame #8: 0x000aa976 JSPatchDemocallSelector(className=0x00000000, selectorName=0x7ba96bc0, arguments=0x7ba8b000, instance=0x7ba9e520, isSuper='\0') + 5558 at JPEngine.m:716 frame #9: 0x000a933c JSPatchDemo23+[JPEngine startEngine]block_invoke_2(.block_descriptor=0x000bb138, obj=0x7ba938a0, selectorName=0x7ba96bc0, arguments=0x7ba94af0, isSuper='\0') + 172 at JPEngine.m:74
      frame #10: 0x007f976d CoreFoundation__invoking_** + 29 frame #11: 0x007f9618 CoreFoundation-[NSInvocation invoke] + 360
      frame #12: 0x01036195 JavaScriptCoreJSC::ObjCCallbackFunctionImpl::call(JSContext_, OpaqueJSValue_, unsigned long, OpaqueJSValue const\* const_, OpaqueJSValue const__) + 485 frame #13: 0x01035cf1 JavaScriptCoreJSC::objCCallbackFunctionCallAsFunction(OpaqueJSContext const
      , OpaqueJSValue_, OpaqueJSValue_, unsigned long, OpaqueJSValue const* const_, OpaqueJSValue const__) + 209
      frame #14: 0x01036e2b JavaScriptCorelong long JSC::APICallbackFunction::callJSC::ObjCCallbackFunction(JSC::ExecState_) + 555 frame #15: 0x00f093f3 JavaScriptCoreJSC::handleHostCall(JSC::ExecState
      , JSC::JSValue, JSC::CodeSpecializationKind) + 579
      frame #16: 0x00f095d3 JavaScriptCorelinkFor + 179 frame #17: 0x00eff5e8 JavaScriptCoreoperationLinkCall + 40
      frame #18: 0xeb9f433a
      frame #19: 0xeb9fb06e
      frame #20: 0xeb9f9f27
      frame #21: 0x01008ef6 JavaScriptCorellint_entry + 17089 frame #22: 0xeb9f7a67 frame #23: 0x01004ab6 JavaScriptCorecallToJavaScript + 261
      frame #24: 0x00ee2d11 JavaScriptCoreJSC::JITCode::execute(JSC::VM_, JSC::ProtoCallFrame_) + 49 frame #25: 0x00ec5145 JavaScriptCoreJSC::Interpreter::executeCall(JSC::ExecState
      , JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 437
      frame #26: 0x00cee2ed JavaScriptCoreJSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 93 frame #27: 0x00f86b8c JavaScriptCoreJSObjectCallAsFunction + 476
      frame #28: 0x00fbd1ea JavaScriptCore-[JSValue callWithArguments:] + 378 frame #29: 0x000b5ee8 JSPatchDemoJPMethodNewImplementation_2(slf=0x7bd41e00, selector=0x01d3c08b, obj1=0x7d210600, obj2=0x7b947180) + 408 at JPEngine.m:357
      frame #30: 0x0154894c UIKit-[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1559 frame #31: 0x01548af7 UIKit-[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 285
      frame #32: 0x0154ddf3 UIKit__38-[UITableView touchesEnded:withEvent:]_block_invoke + 43 frame #33: 0x014620ce UIKit___afterCACommitHandler_block_invoke + 15
      frame #34: 0x01462079 UIKit_applyBlockToCFArrayCopiedToStack + 415 frame #35: 0x01461e8e UIKit_afterCACommitHandler + 545
      frame #36: 0x008399de CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30 frame #37: 0x00839920 CoreFoundation__CFRunLoopDoObservers + 400
      frame #38: 0x0082f35a CoreFoundation__CFRunLoopRun + 1226 frame #39: 0x0082ebcb CoreFoundationCFRunLoopRunSpecific + 443
      frame #40: 0x0082e9fb CoreFoundationCFRunLoopRunInMode + 123 frame #41: 0x0438d24f GraphicsServicesGSEventRunModal + 192
      frame #42: 0x0438d08c GraphicsServicesGSEventRun + 104 frame #43: 0x014388b6 UIKitUIApplicationMain + 1526
      frame #44: 0x000b782d JSPatchDemomain(argc=1, argv=0xbff5a410) + 141 at main.m:14 frame #45: 0x033ebac9 libdyld.dylibstart + 1

defineClass in JSPatch, target actions pattern and selector

Hey

I noticed that defineClass (JPEngine.m:144) only override those methods that already exsit in the OC class; otherwise the new methods of user define stay in JS, which mean you can't call your new methods in OC.

So you can't use the target actions pattern and selector, and I guess is really important:

var button = UIButton.alloc().init()
// It doesn't work, and you can't create selector like that for now.
button.addTarget_action_forControlEvents(self, @selector("buttonTapped:", 0)

In the demo, it doesn't work when handleBtn doesn't exist:

// JPViewController
@implementation JPViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, 50)];
    [btn setTitle:@"Push JPTableViewController" forState:UIControlStateNormal];

    // try to call @selector(handleBtn:), which define in demo.js
    [btn addTarget:self action:@selector(handleBtn:) forControlEvents:UIControlEventTouchUpInside];
    [btn setBackgroundColor:[UIColor grayColor]];
    [self.view addSubview:btn];
}

/** comment this and it will crash
- (void)handleBtn:(id)sender
{
}
*/
@end
// demo.js
defineClass('JPViewController', {
  handleBtn: function(sender) {
    var tableViewCtrl = JPTableViewController.alloc().init()
    self.navigationController().pushViewController_animated(tableViewCtrl, YES)
  },
})
...

I guess we can covert all the user define JS functions into OC methods(override if exist, add new one if not) to solve this problem, and define a new way to convert string(or something else) to SEL from JS to OC.

Any suggestion?

请问这种block该怎么在js中取值

typedef NSDictionary *(^Param)(void);

这种block 该怎么在js中调用,拿到NSDictionary值,我在js中直接 var param = testBlock();后拿不到值

class function gets an error

I add a class function hello() to demo.js:

defineClass('JPTableViewController : UITableViewController', {
    ...
    tableView_heightForRowAtIndexPath: function(tableView, indexPath) {
        return 60
    }
}, {
    //class method definitions
    hello: function() {
        console.log("hello");
        return "I'm JPTableViewController"
    }
})

And called hello():

defineClass('JPViewController', {
    handleBtn: function(sender) {
        var tableViewCtrl = JPTableViewController.alloc().init();
        console.log(JPTableViewController.hello());

        self.navigationController().pushViewController_animated(
            tableViewCtrl, YES)
    }
})

hello() works, (it prints logs,) but rises an error:

2015-05-26 19:29:46.642 JSPatchDemo[31797:867980] JSPatch.log: hello
2015-05-26 19:29:46.643 JSPatchDemo[31797:867980] JSPatch.log: I'm JPTableViewController
2015-05-26 19:29:46.647 JSPatchDemo[31797:867980] TypeError: null is not an object (evaluating 'self.__c')
2015-05-26 19:29:46.647 JSPatchDemo[31797:867980] *** Assertion failure in +[JPEngine startEngine], /Users/path/JSPatch/JSPatch/JPEngine.m:111
2015-05-26 19:29:46.650 JSPatchDemo[31797:867980] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'js exception: TypeError: null is not an object (evaluating 'self.__c')'
...

I notice in #10 you said "By now, JSPatch can't add method to an OC class if the method not exists in OC". Thanks for your work~

a problem in class inheritance

three classes A,B,C
A <|-- B <|-- C

A has a method m3, m3 is overrided in B by a JS method. call m3 in class C. value should be the js m3 return value.

if I add a override function in InheritTest.js, class JPInheritTest02ObjectC
m3:function(){
return self.super.m3();
}

the unit test will crash

iOS Developer Program License Agreement

I suggest that the README should address the JavaScriptCore's limitation which listed in iOS Developer Program License Agreement here.

Especially, the 3.3.2:

3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework or JavascriptCore, provided that such scripts and code do not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store.

Furthermore, downloading scripts via HTTP connection can be a huge risk of security. Do you have any advice?

some function not work

Hi, I think this engine is great! Thanks for your works!

I add a function tableView_didSelectRowAtIndexPath after tableView_heightForRowAtIndexPath in demo.js, like this:

    tableView_heightForRowAtIndexPath: function(tableView, indexPath) {
        return 60
    },
    tableView_didSelectRowAtIndexPath: function(tableView, indexPath) {
        console.log("did select row at index path");
    }

when I click cells of the table view, Xcode didn't log "did select row at index path".

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.