¡@

Home 

2014/10/15 ¤U¤È 10:13:34

iphone Programming Glossary: runtime

Difference between objectForKey and valueForKey?

http://stackoverflow.com/questions/1062183/difference-between-objectforkey-and-valueforkey

KVC doesn't look all that useful. In fact it looks wordy . But when you want to change things at runtime you can do lots of cool things that are much more difficult in other languages but this is beyond the..

Delete/Reset all entries in Core Data?

http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data

the store and recreating it is both fast and safe and can certainly be done programatically at runtime. Update for iOS5 With the introduction of external binary storage allowsExternalBinaryDataStorage or..

@synthesize vs @dynamic, what are the differences?

http://stackoverflow.com/questions/1160498/synthesize-vs-dynamic-what-are-the-differences

implemented not by the class itself but somewhere else like the superclass or will be provided at runtime . Uses for @dynamic are e.g. with subclasses of NSManagedObject CoreData or when you want to create..

How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

http://stackoverflow.com/questions/2576356/how-does-one-get-ui-user-interface-idiom-to-work-with-iphone-os-sdk-3-2

earlier when compiling for iPhone simulator 3.1.3. If this is the recommended by Apple approach to runtime device detection what am I doing wrong Has anyone succeeded using this approach to device detection..

Universal iPhone/iPad application debug compilation error for iPhone testing

http://stackoverflow.com/questions/2618889/universal-iphone-ipad-application-debug-compilation-error-for-iphone-testing

Type for UIKit from Required to Weak and rebuild your application. That should take care of the runtime errors. Your conditional logic is sound but I tend to share an application delegate and do the interface..

How does Apple know you are using private API?

http://stackoverflow.com/questions/2842357/how-does-apple-know-you-are-using-private-api

of private APIs. If you really really really really want to workaround these checks you could use runtime features such as dlopen dlsym objc_getClass sel_registerName objc_msgSend valueForKey object_getInstanceVariable..

Is it true that one should not use NSLog() on production code?

http://stackoverflow.com/questions/300673/is-it-true-that-one-should-not-use-nslog-on-production-code

that writes to its own log file or database and includes a 'priority' argument you could set at runtime so debug messages are not shown in your release version but error messages are if you did this you could..

This class is not key value coding-compliant for the key

http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key

the problem. By the way it is bad practice to have names like string in Objective C. It invites a runtime naming collision. Avoid them even in once off practice apps. Naming collisions can be very hard to track..

Property Declaration and Automatic Backing Storage Allocation

http://stackoverflow.com/questions/3238009/property-declaration-and-automatic-backing-storage-allocation

declaring the ivar iphone objective c share improve this question On the modern Objective C runtime nonfragile abi they are the same the ivar backing will be created automatically by the @synthesize declaration... same the ivar backing will be created automatically by the @synthesize declaration. This is the runtime used by iPhone and 64 bit Mac OS X apps. 32 bit Mac OS X use the legacy runtime where it is not possible.. This is the runtime used by iPhone and 64 bit Mac OS X apps. 32 bit Mac OS X use the legacy runtime where it is not possible to synthesize the ivar and the second bit of code you wrote would not compile..

Set line height in UITextView

http://stackoverflow.com/questions/3760924/set-line-height-in-uitextview

change the line height in a UITextView Would be enough to do it statically no need to change it at runtime. The problem is that the default line height is just WAY too small. Text will look extremely compressed..

How do I manage building a Lite vs Paid version of an iPhone app?

http://stackoverflow.com/questions/549462/how-do-i-manage-building-a-lite-vs-paid-version-of-an-iphone-app

performSelector may cause a leak because its selector is unknown

http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown

All objects respond to methodForSelector and it works through some lower level Objective C runtime methods so you could do this directly with the runtime API as well . These function pointers are called.. works through some lower level Objective C runtime methods so you could do this directly with the runtime API as well . These function pointers are called IMP s and are simple typedef ed function pointers id.. selector someRect someView Reasoning for Warning The reason for this warning is that with ARC the runtime needs to know what to do with the result of the method you're calling. The result could be anything..

Property vs. instance variable

http://stackoverflow.com/questions/719788/property-vs-instance-variable

be used instead of direct access. @interface APerson NSObject NSString _name necessary for legacy runtime @property readwrite NSString name @end @implementation APerson @synthesize name use name _name for.. readwrite NSString name @end @implementation APerson @synthesize name use name _name for legacy runtime @end @synthesize creates in this case those two methods not 100 accurate NSString name return _name..

To ARC or not to ARC? What are the pros and cons?

http://stackoverflow.com/questions/8760431/to-arc-or-not-to-arc-what-are-the-pros-and-cons

than your old code. It is easier than your old code. It is not garbage collection. It has no GC runtime cost. The compiler inserts retains and releases in all the places you should have anyway. But it's smarter..

Difference between objectForKey and valueForKey?

http://stackoverflow.com/questions/1062183/difference-between-objectforkey-and-valueforkey

of statements. I know you're thinking wow but sarcastically. KVC doesn't look all that useful. In fact it looks wordy . But when you want to change things at runtime you can do lots of cool things that are much more difficult in other languages but this is beyond the scope of your question . If you want to learn more about KVC..

Delete/Reset all entries in Core Data?

http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data

or you won't be able to persist your changes. Just removing the store and recreating it is both fast and safe and can certainly be done programatically at runtime. Update for iOS5 With the introduction of external binary storage allowsExternalBinaryDataStorage or Store in External Record File in iOS 5 and OS X 10.7 simply..

@synthesize vs @dynamic, what are the differences?

http://stackoverflow.com/questions/1160498/synthesize-vs-dynamic-what-are-the-differences

tells the compiler that the getter and setter methods are implemented not by the class itself but somewhere else like the superclass or will be provided at runtime . Uses for @dynamic are e.g. with subclasses of NSManagedObject CoreData or when you want to create an outlet for a property defined by a superclass that was not..

How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

http://stackoverflow.com/questions/2576356/how-does-one-get-ui-user-interface-idiom-to-work-with-iphone-os-sdk-3-2

errors since the symbols are not defined in 3.1.3 or earlier when compiling for iPhone simulator 3.1.3. If this is the recommended by Apple approach to runtime device detection what am I doing wrong Has anyone succeeded using this approach to device detection iphone ipad iphone sdk 3.2 share improve this question ..

Universal iPhone/iPad application debug compilation error for iPhone testing

http://stackoverflow.com/questions/2618889/universal-iphone-ipad-application-debug-compilation-error-for-iphone-testing

be a list of frameworks with a column for Type. Change the Type for UIKit from Required to Weak and rebuild your application. That should take care of the runtime errors. Your conditional logic is sound but I tend to share an application delegate and do the interface specific layout further down the line. Update 12 21 2011..

How does Apple know you are using private API?

http://stackoverflow.com/questions/2842357/how-does-apple-know-you-are-using-private-api

APIKit to detect potential rejection due to false alarms of private APIs. If you really really really really want to workaround these checks you could use runtime features such as dlopen dlsym objc_getClass sel_registerName objc_msgSend valueForKey object_getInstanceVariable object_getIvar etc. to get those private libraries..

Is it true that one should not use NSLog() on production code?

http://stackoverflow.com/questions/300673/is-it-true-that-one-should-not-use-nslog-on-production-code

C objects. For instance you could have a logging class that writes to its own log file or database and includes a 'priority' argument you could set at runtime so debug messages are not shown in your release version but error messages are if you did this you could make DebugLog WarningLog and so on . Oh and keep in mind..

This class is not key value coding-compliant for the key

http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key

of SecondView . Changing to the correct class resolves the problem. By the way it is bad practice to have names like string in Objective C. It invites a runtime naming collision. Avoid them even in once off practice apps. Naming collisions can be very hard to track down and you don't want to waste the time. share improve..

Property Declaration and Automatic Backing Storage Allocation

http://stackoverflow.com/questions/3238009/property-declaration-and-automatic-backing-storage-allocation

defined What are the ramifications of not explicitly declaring the ivar iphone objective c share improve this question On the modern Objective C runtime nonfragile abi they are the same the ivar backing will be created automatically by the @synthesize declaration. This is the runtime used by iPhone and 64 bit Mac.. On the modern Objective C runtime nonfragile abi they are the same the ivar backing will be created automatically by the @synthesize declaration. This is the runtime used by iPhone and 64 bit Mac OS X apps. 32 bit Mac OS X use the legacy runtime where it is not possible to synthesize the ivar and the second bit of code you wrote.. will be created automatically by the @synthesize declaration. This is the runtime used by iPhone and 64 bit Mac OS X apps. 32 bit Mac OS X use the legacy runtime where it is not possible to synthesize the ivar and the second bit of code you wrote would not compile properly. The most recent versions of the iPhone simulator..

Set line height in UITextView

http://stackoverflow.com/questions/3760924/set-line-height-in-uitextview

any public API but I still want to ask Is there any way to change the line height in a UITextView Would be enough to do it statically no need to change it at runtime. The problem is that the default line height is just WAY too small. Text will look extremely compressed and is a nightmare when trying to write longer texts. thanks..

How do I manage building a Lite vs Paid version of an iPhone app?

http://stackoverflow.com/questions/549462/how-do-i-manage-building-a-lite-vs-paid-version-of-an-iphone-app

performSelector may cause a leak because its selector is unknown

http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown

C function pointer for the method corresponding to the controller. All objects respond to methodForSelector and it works through some lower level Objective C runtime methods so you could do this directly with the runtime API as well . These function pointers are called IMP s and are simple typedef ed function pointers id IMP.. controller. All objects respond to methodForSelector and it works through some lower level Objective C runtime methods so you could do this directly with the runtime API as well . These function pointers are called IMP s and are simple typedef ed function pointers id IMP id SEL ... 1 . This may be close to the actual method.. id SEL CGRect UIView void imp CGRect result func _controller selector someRect someView Reasoning for Warning The reason for this warning is that with ARC the runtime needs to know what to do with the result of the method you're calling. The result could be anything void int char NSString id etc. ARC normally gets this information..

Property vs. instance variable

http://stackoverflow.com/questions/719788/property-vs-instance-variable

just setters and getters for ivars and should almost always be used instead of direct access. @interface APerson NSObject NSString _name necessary for legacy runtime @property readwrite NSString name @end @implementation APerson @synthesize name use name _name for legacy runtime @end @synthesize creates in this case those two.. NSString _name necessary for legacy runtime @property readwrite NSString name @end @implementation APerson @synthesize name use name _name for legacy runtime @end @synthesize creates in this case those two methods not 100 accurate NSString name return _name copy autorelease void setName NSString value value retain _name..

To ARC or not to ARC? What are the pros and cons?

http://stackoverflow.com/questions/8760431/to-arc-or-not-to-arc-what-are-the-pros-and-cons

it. Do it today. It is faster than your old code. It is safer than your old code. It is easier than your old code. It is not garbage collection. It has no GC runtime cost. The compiler inserts retains and releases in all the places you should have anyway. But it's smarter than you and can optimize out the ones that aren't actually..

Difference between objectForKey and valueForKey?

http://stackoverflow.com/questions/1062183/difference-between-objectforkey-and-valueforkey

but sarcastically. KVC doesn't look all that useful. In fact it looks wordy . But when you want to change things at runtime you can do lots of cool things that are much more difficult in other languages but this is beyond the scope of your question..

Delete/Reset all entries in Core Data?

http://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data

changes. Just removing the store and recreating it is both fast and safe and can certainly be done programatically at runtime. Update for iOS5 With the introduction of external binary storage allowsExternalBinaryDataStorage or Store in External Record..

@synthesize vs @dynamic, what are the differences?

http://stackoverflow.com/questions/1160498/synthesize-vs-dynamic-what-are-the-differences

setter methods are implemented not by the class itself but somewhere else like the superclass or will be provided at runtime . Uses for @dynamic are e.g. with subclasses of NSManagedObject CoreData or when you want to create an outlet for a property..

How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

http://stackoverflow.com/questions/2576356/how-does-one-get-ui-user-interface-idiom-to-work-with-iphone-os-sdk-3-2

defined in 3.1.3 or earlier when compiling for iPhone simulator 3.1.3. If this is the recommended by Apple approach to runtime device detection what am I doing wrong Has anyone succeeded using this approach to device detection iphone ipad iphone..

Universal iPhone/iPad application debug compilation error for iPhone testing

http://stackoverflow.com/questions/2618889/universal-iphone-ipad-application-debug-compilation-error-for-iphone-testing

for Type. Change the Type for UIKit from Required to Weak and rebuild your application. That should take care of the runtime errors. Your conditional logic is sound but I tend to share an application delegate and do the interface specific layout..

How does Apple know you are using private API?

http://stackoverflow.com/questions/2842357/how-does-apple-know-you-are-using-private-api

due to false alarms of private APIs. If you really really really really want to workaround these checks you could use runtime features such as dlopen dlsym objc_getClass sel_registerName objc_msgSend valueForKey object_getInstanceVariable object_getIvar..

Is it true that one should not use NSLog() on production code?

http://stackoverflow.com/questions/300673/is-it-true-that-one-should-not-use-nslog-on-production-code

have a logging class that writes to its own log file or database and includes a 'priority' argument you could set at runtime so debug messages are not shown in your release version but error messages are if you did this you could make DebugLog WarningLog..

This class is not key value coding-compliant for the key

http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the-key

class resolves the problem. By the way it is bad practice to have names like string in Objective C. It invites a runtime naming collision. Avoid them even in once off practice apps. Naming collisions can be very hard to track down and you don't..

Property Declaration and Automatic Backing Storage Allocation

http://stackoverflow.com/questions/3238009/property-declaration-and-automatic-backing-storage-allocation

of not explicitly declaring the ivar iphone objective c share improve this question On the modern Objective C runtime nonfragile abi they are the same the ivar backing will be created automatically by the @synthesize declaration. This is.. abi they are the same the ivar backing will be created automatically by the @synthesize declaration. This is the runtime used by iPhone and 64 bit Mac OS X apps. 32 bit Mac OS X use the legacy runtime where it is not possible to synthesize the.. @synthesize declaration. This is the runtime used by iPhone and 64 bit Mac OS X apps. 32 bit Mac OS X use the legacy runtime where it is not possible to synthesize the ivar and the second bit of code you wrote would not compile properly. The most..

Set line height in UITextView

http://stackoverflow.com/questions/3760924/set-line-height-in-uitextview

Is there any way to change the line height in a UITextView Would be enough to do it statically no need to change it at runtime. The problem is that the default line height is just WAY too small. Text will look extremely compressed and is a nightmare..

How do I manage building a Lite vs Paid version of an iPhone app?

http://stackoverflow.com/questions/549462/how-do-i-manage-building-a-lite-vs-paid-version-of-an-iphone-app

performSelector may cause a leak because its selector is unknown

http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown

to the controller. All objects respond to methodForSelector and it works through some lower level Objective C runtime methods so you could do this directly with the runtime API as well . These function pointers are called IMP s and are simple.. and it works through some lower level Objective C runtime methods so you could do this directly with the runtime API as well . These function pointers are called IMP s and are simple typedef ed function pointers id IMP id SEL ... 1 ... func _controller selector someRect someView Reasoning for Warning The reason for this warning is that with ARC the runtime needs to know what to do with the result of the method you're calling. The result could be anything void int char NSString..

Property vs. instance variable

http://stackoverflow.com/questions/719788/property-vs-instance-variable

should almost always be used instead of direct access. @interface APerson NSObject NSString _name necessary for legacy runtime @property readwrite NSString name @end @implementation APerson @synthesize name use name _name for legacy runtime @end.. runtime @property readwrite NSString name @end @implementation APerson @synthesize name use name _name for legacy runtime @end @synthesize creates in this case those two methods not 100 accurate NSString name return _name copy autorelease void..

To ARC or not to ARC? What are the pros and cons?

http://stackoverflow.com/questions/8760431/to-arc-or-not-to-arc-what-are-the-pros-and-cons

old code. It is safer than your old code. It is easier than your old code. It is not garbage collection. It has no GC runtime cost. The compiler inserts retains and releases in all the places you should have anyway. But it's smarter than you and..

Placeholder in UITextView

http://stackoverflow.com/questions/1328638/placeholder-in-uitextview

release _placeholder nil super dealloc #endif void awakeFromNib super awakeFromNib Use Interface Builder User Defined Runtime Attributes to set placeholder and placeholderColor in Interface Builder. if self.placeholder self setPlaceholder @ if self.placeholderColor..

Cross-compile Autotools-based Libraries for Official iPhone SDK

http://stackoverflow.com/questions/1602182/cross-compile-autotools-based-libraries-for-official-iphone-sdk

compiling these thirdparty libraries for the iPhone and iPhone simulator. The libraries include the Apache Portable Runtime and GNUTLS as well as their dependencies. I would like the built libraries to end up in the prefixes opt iphone 3.1 opt..

Create a class at runtime - Why do NSClassFromString AND objc_getclass return nil?

http://stackoverflow.com/questions/1634644/create-a-class-at-runtime-why-do-nsclassfromstring-and-objc-getclass-return-ni

NSClassFromString or objc_getclass will not return nil iphone runtime share improve this question The Objective C Runtime Reference can help you here. For example the documentation for objc_getClass says The Class object for the named class or..

User Defined Runtime Attributes in IB for iPhone not working

http://stackoverflow.com/questions/3980251/user-defined-runtime-attributes-in-ib-for-iphone-not-working

Defined Runtime Attributes in IB for iPhone not working I have a weird problem. I am trying to setup User Defined Runtime Attribute in.. Defined Runtime Attributes in IB for iPhone not working I have a weird problem. I am trying to setup User Defined Runtime Attribute in the IB. As shown below I setup a NSString statID attribute in my viewController and wanted to give it a test.. to 10.6 I know I can set up user defined attributes in iOS from the iOS docs found here go down to section Configuring Runtime Attributes for Custom Objects Any idea why it is giving me the error iphone interface builder share improve this question..

Weird crash issue on iOS 4.3

http://stackoverflow.com/questions/5295841/weird-crash-issue-on-ios-4-3

logs. I don't have any theories at this point. Anyone Debug Console SourceCache ProtocolBuffer ProtocolBuffer 51.2 Runtime PBRequester.m 684 server returned error 503 Console Mar 14 12 06 21 unknown kernel 0 Debug launchd 444 Builtin profile container.. 12 06 39 unknown UIKitApplication com.MyiPhone.MyApp 0xa818 447 Notice SourceCache ProtocolBuffer ProtocolBuffer 51.2 Runtime PBRequester.m 684 server returned error 503 Mar 14 12 06 39 unknown ReportCrash 448 Notice Formulating crash report for..

HTTP Live Streaming with AVPlayer in iOS 4.0?

http://stackoverflow.com/questions/6431517/http-live-streaming-with-avplayer-in-ios-4-0

need a working solution with AVPlayer. Does anyone know how to get Apple's StichedStreamPlayer code to work on 4.0 The Runtime Requirements say it should work on iOS 4.0 or later . Thanks iphone ios avfoundation avplayer http live streaming share..

iPhone/iOS: How Do I Tell What Localization The Phone is Using At Runtime?

http://stackoverflow.com/questions/6998250/iphone-ios-how-do-i-tell-what-localization-the-phone-is-using-at-runtime

iOS How Do I Tell What Localization The Phone is Using At Runtime I'm having a difficult time localizing an app. It needs to be localized into Farsi Iranian Persian . Not only that it needs..

What is the difference between Objective-C automatic reference counting and garbage collection?

http://stackoverflow.com/questions/7874342/what-is-the-difference-between-objective-c-automatic-reference-counting-and-garb

automatic ref counting share improve this question the short and sweet answer is as follow GC of java is Runtime while ARC is compile time. GC has reference to the objects at runtime and check for the dependencies of object runtime...

Runtime change the language/localization in Three20

http://stackoverflow.com/questions/8351445/runtime-change-the-language-localization-in-three20

change the language localization in Three20 Is it possible to change the Three20 language localization at runtime without..

Objective-C 2.0: class_copyPropertyList(), how to list properties from categories

http://stackoverflow.com/questions/848636/objective-c-2-0-class-copypropertylist-how-to-list-properties-from-categorie

from categories I tried to list all properties of an Objective C class like described in the Objective C 2.0 Runtime Programming Guide id LenderClass objc_getClass UIView unsigned int outCount i objc_property_t properties class_copyPropertyList..

Custom font in a storyboard?

http://stackoverflow.com/questions/9090745/custom-font-in-a-storyboard

To specify the font in Storyboard just select the desired element label button textview etc and add a User Defined Runtime Attribute with Key Path set to fontName of type String and value with the name of your custom font. And that's it you don't..