¡@

Home 

2014/10/15 ¤U¤È 10:04:47

iphone Programming Glossary: by

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

the UIScrollView to see the other text fields once the keyboard is brought up Automatically jump by scrolling up or shortening I know that I need a UIScrollView . I've tried changing the class of my UIView.. write code for what needs it. Note the UIView or UIScrollView that I'm working with is brought up by a tabbar UITabBar which needs to function as normal. Edit I am adding the scroll bar just for when the.. up when keyboard comes up then it's not needed. For showing the textfields without being hidden by the keyboard the standard way is to move up down the view having textfields whenever the keyboard is..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

is here to prevent precision errors when comparing floating points as pointed in the comments by H2CO3. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better.. you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection As stated by some people this does only detect a widescreen not an actual iPhone 5. Next versions of the iPod touch.. the IS_IPHONE_5 macro #define IS_IPHONE_5 IS_IPHONE IS_WIDESCREEN Also note that as stated by @LearnCocos2D this macros won't work if the application is not optimised for the iPhone 5 screen missing..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

as part of the build. I have all of these files together inside a single directory that is indexed by spotlight. What now I have tried invoking symbolicatecrash crashreport.crash myApp.app.dSYM and it just..

How do I detect when someone shakes an iPhone?

http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone

can easily transform any UIView even system views into a view that can get the shake event simply by subclassing the view with only these methods and then selecting this new type instead of the base type..

How to force NSLocalizedString to use a specific language

http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language

languages are. This returns an array of language codes with the first one being the one set by the user for their phone and the subsequent ones used as fallbacks if a resource is not available in.. in System Preferences You can override the global setting for your own application if you wish by using the setObject forKey method to set your own language list. This will take precedence over the..

Programmatically get own phone number in iOS

http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios

get own phone number in iOS Is there any way to get own phone number by standard APIs from iPhone SDK iphone ios mobile phones phone number share improve this question ..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

is present in the iPhone SDK to access SOAP services Since the service I need to access is exposed by another party and they only expose it as SOAP it's unfortunately not an option to switch to another..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

same approach we used for handling custom URL schemes. You can separate the file URLs from others by using code like the following if url isFileURL Handle file being passed in else Handle custom URL scheme..

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

I've implemented touch based rotation and scaling on a couple of CALayers based on an example by Bill Dudney. The newest version of the program at the very bottom of the page implements this kind of..

Prefixing property names with an underscore in Objective C [duplicate]

http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c

You can optionally assign a different ivar in the @property declaration but the fact that by default synthesized accessors for a property will access the ivar with the same name as the property..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

if they will be using memory beware of leaving contexts open though Recycle page objects by doing pointer swaps or destroy unused views Close any open Contexts as soon as you don't need them on..

How do I create delegates in Objective-C?

http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c

something didFailWithError @end Then in the body we can check that our delegate handles messages by accessing our delegateRespondsTo struct rather than by sending respondsToSelector over and over again...

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

and re installs the app. iphone ios ipad share improve this question A UUID created by CFUUIDCreate is unique if a user uninstalls and re installs the app you will get a new one each time... en0 . The MAC is always present even if the interface has no IP is down. Edit 2 As was pointed out by others the preferred solution since iOS 6 is UIDevice identifierForVendor . In most cases you should..

Autorotate in iOS 6 has strange behaviour

http://stackoverflow.com/questions/12526054/autorotate-in-ios-6-has-strange-behaviour

UINavigationController do not consult their children to determine whether they should autorotate. By default an app and a view controller ™s supported interface orientations are set to UIInterfaceOrientationMaskAll..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

don't need .dSYM file. Note This can only work if the app binary does not have symbols stripped. By default release builds stripped the symbols. We can change it in project build settings Strip Debug..

Changing my CALayer's anchorPoint moves the view

http://stackoverflow.com/questions/1968017/changing-my-calayers-anchorpoint-moves-the-view

the position of a layer is specified in terms of the location of the layer's anchorPoint. By default a layer's anchorPoint is 0.5 0.5 which lies at the center of the layer. When you set the position..

Send and receive messages through NSNotificationCenter in Objective-C? [closed]

http://stackoverflow.com/questions/2191594/send-and-receive-messages-through-nsnotificationcenter-in-objective-c

center to inform us of TestNotification notifications using the receiveTestNotification selector. By specifying object nil we tell the notification center that we are not interested in who posted the notification...

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 UIViewController instead 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...

Can I make POST or GET requests from an iphone application?

http://stackoverflow.com/questions/319463/can-i-make-post-or-get-requests-from-an-iphone-application

Once this method is invoked responseData contains the complete result This will send a GET. By the time the final method is called responseData will contain the entire HTTP response convert to string..

How do I reset after a UIScrollView zoom?

http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom

at new scale here contentView.previousScale scale scrollView.contentSize contentView.frame.size By doing this the transforms sent to the content view are adjusted based on the scale at which the view..

iPhone - Backgrounding to poll for events

http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events

handler in this case my 'expirationHandler' block will be executed if execution time is over. By defining the block into a block variable one can recursively start the long running task again within..

Lock-down iPhone/iPod/iPad so it can only run one app

http://stackoverflow.com/questions/5011774/lock-down-iphone-ipod-ipad-so-it-can-only-run-one-app

includes an 'App Lock' payload as part of the device configuration profile. From the Apple docs By installing an app lock payload the device is locked to a single application until the payload is removed...

Understanding reference counting with Cocoa and Objective-C

http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c

of how many times it is being referenced specifically the NSObject base class implements this . By calling retain on an object you are telling it that you want to up its reference count by one. By calling.. By calling retain on an object you are telling it that you want to up its reference count by one. By calling release you tell the object you are letting go of it and its reference count is decremented... knows about me. As described above an object's reference count is incremented by calling retain . By convention it is also incremented set to 1 really when the object is created with an init method. In..

Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working?

http://stackoverflow.com/questions/6901363/detecting-the-iphones-ring-silent-mute-switch-using-avaudioplayer-not-worki

event is fired when the physical switch on the phone is ... switched. Anyone have any ideas By the way I'm using the AVAudioSessionCategoryAmbient category with my AVAudioSession sharedInstance ...

Lock Unlock events iphone

http://stackoverflow.com/questions/706344/lock-unlock-events-iphone

the iPhone Assuming it's only possible for jailbroken devices can you point me to the correct API By lock events I mean showing or hiding the Lock Screen which might need a password to unlock or not ...

How to write data in plist?

http://stackoverflow.com/questions/905542/how-to-write-data-in-plist

. I am able to read that data but I cant able write through coding into the same save.plist. By using following code I am trying to write the data but it get stored within my .app plist. The code.. manager NSFileManager defaultManager if plistPath NSBundle mainBundle bundlePath stringByAppendingPathComponent @ Contents Info.plist if manager isWritableFileAtPath plistPath NSMutableDictionary..

View Controllers: How to switch between views programmatically?

http://stackoverflow.com/questions/910994/view-controllers-how-to-switch-between-views-programmatically

vcA ViewControllerA alloc initWithNib self.contentView addSubview vcA.view cvA release By the way the initWithNib method looks like this id initWithNib Load the view nib if self super initWithNibName..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

consume a few dozen KBs when compressed but consumes over half a MB decompressed width height 4 . By contrast imageWithContentsOfFile will decompress that image everytime the image data is needed. As you.. CGImageGetBitsPerComponent originalImage CGImageGetBitsPerPixel originalImage CGImageGetBytesPerRow originalImage CGImageGetColorSpace originalImage CGImageGetBitmapInfo originalImage imageDataProvider..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

I need it to be able to Allow scrolling of the contents of the UIScrollView to see the other text fields once the keyboard is brought up Automatically jump by scrolling up or shortening I know that I need a UIScrollView . I've tried changing the class of my UIView to a UIScrollView but I'm still unable to scroll the textboxes.. possible will be done in Interface Builder. I'd like to only write code for what needs it. Note the UIView or UIScrollView that I'm working with is brought up by a tabbar UITabBar which needs to function as normal. Edit I am adding the scroll bar just for when the keyboard comes up. Even though it's not needed I feel like.. are adding the scroll view just to make the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without being hidden by the keyboard the standard way is to move up down the view having textfields whenever the keyboard is shown. Here is some sample code #define kOFFSET_FOR_KEYBOARD..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

double 568 DBL_EPSILON The use of fabs with the epsilon is here to prevent precision errors when comparing floating points as pointed in the comments by H2CO3. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection As stated by some people this does only detect a widescreen.. points as pointed in the comments by H2CO3. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection As stated by some people this does only detect a widescreen not an actual iPhone 5. Next versions of the iPod touch will maybe also have such a screen so we may use another.. ensure we have an iPhone model AND a widescreen and we can redefine the IS_IPHONE_5 macro #define IS_IPHONE_5 IS_IPHONE IS_WIDESCREEN Also note that as stated by @LearnCocos2D this macros won't work if the application is not optimised for the iPhone 5 screen missing the Default 568h@2x.png image as the screen size will still..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

the App Store and I have the dSYM file that was generated as part of the build. I have all of these files together inside a single directory that is indexed by spotlight. What now I have tried invoking symbolicatecrash crashreport.crash myApp.app.dSYM and it just outputs the same text that is in the crash report to start..

How do I detect when someone shakes an iPhone?

http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone

event BOOL canBecomeFirstResponder return YES @end You can easily transform any UIView even system views into a view that can get the shake event simply by subclassing the view with only these methods and then selecting this new type instead of the base type in IB or using it when allocating a view . In the view controller..

How to force NSLocalizedString to use a specific language

http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language

NSUserDefaults to determine what the user's settings for preferred languages are. This returns an array of language codes with the first one being the one set by the user for their phone and the subsequent ones used as fallbacks if a resource is not available in the preferred language. on the desktop the user can specify.. the user can specify multiple languages with a custom ordering in System Preferences You can override the global setting for your own application if you wish by using the setObject forKey method to set your own language list. This will take precedence over the globally set value and be returned to any code in your application..

Programmatically get own phone number in iOS

http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios

get own phone number in iOS Is there any way to get own phone number by standard APIs from iPhone SDK iphone ios mobile phones phone number share improve this question At the risk of getting negative marks I want to suggest that..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

already write a library using the functionality that is present in the iPhone SDK to access SOAP services Since the service I need to access is exposed by another party and they only expose it as SOAP it's unfortunately not an option to switch to another type of interface e.g. REST based API . Gero iphone ios web..

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

A full example of this with code can be found here where I've implemented touch based rotation and scaling on a couple of CALayers based on an example by Bill Dudney. The newest version of the program at the very bottom of the page implements this kind of perspective operation. The code should be reasonably simple..

Prefixing property names with an underscore in Objective C [duplicate]

http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c

C 2.0 practice is to use the same name for the ivar as the property. You can optionally assign a different ivar in the @property declaration but the fact that by default synthesized accessors for a property will access the ivar with the same name as the property indicates that's the pattern they expect you to follow. No..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

a singleton. Cancel needless NSOperations When you can especially if they will be using memory beware of leaving contexts open though Recycle page objects by doing pointer swaps or destroy unused views Close any open Contexts as soon as you don't need them on receiving memory warnings release and reload the DocRef and..

How do I create delegates in Objective-C?

http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

class. However this value won't be the same if a user uninstalls and re installs the app. iphone ios ipad share improve this question A UUID created by CFUUIDCreate is unique if a user uninstalls and re installs the app you will get a new one each time. But you might want it to be not unique i. e. it should stay.. the same interface of course. I guess the best bet is with en0 . The MAC is always present even if the interface has no IP is down. Edit 2 As was pointed out by others the preferred solution since iOS 6 is UIDevice identifierForVendor . In most cases you should be able use it as a drop in replacement to the old UIDevice..

Autorotate in iOS 6 has strange behaviour

http://stackoverflow.com/questions/12526054/autorotate-in-ios-6-has-strange-behaviour

to the app and the app delegate. Now iOS containers such as UINavigationController do not consult their children to determine whether they should autorotate. By default an app and a view controller ™s supported interface orientations are set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

Changing my CALayer's anchorPoint moves the view

http://stackoverflow.com/questions/1968017/changing-my-calayers-anchorpoint-moves-the-view

between a CALayer's position and anchorPoint properties. Basically the position of a layer is specified in terms of the location of the layer's anchorPoint. By default a layer's anchorPoint is 0.5 0.5 which lies at the center of the layer. When you set the position of the layer you are then setting the location of the..

Send and receive messages through NSNotificationCenter in Objective-C? [closed]

http://stackoverflow.com/questions/2191594/send-and-receive-messages-through-nsnotificationcenter-in-objective-c

observer of the TestNotification. We tell the notification center to inform us of TestNotification notifications using the receiveTestNotification selector. By specifying object nil we tell the notification center that we are not interested in who posted the notification. If you provided an actual object rather than nil..

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

by the Second view controller in MainWindow.xib having a class of UIViewController instead 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 I make POST or GET requests from an iphone application?

http://stackoverflow.com/questions/319463/can-i-make-post-or-get-requests-from-an-iphone-application

error void connectionDidFinishLoading NSURLConnection connection Once this method is invoked responseData contains the complete result This will send a GET. By the time the final method is called responseData will contain the entire HTTP response convert to string with NSString alloc initWithData encoding . Alternately..

How do I reset after a UIScrollView zoom?

http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom

CGAffineTransformIdentity Code to manually redraw view at new scale here contentView.previousScale scale scrollView.contentSize contentView.frame.size By doing this the transforms sent to the content view are adjusted based on the scale at which the view was last redrawn. When the pinch zooming is done the transform..

iPhone - Backgrounding to poll for events

http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events

the VoIP hack. According to the documentation the expiration handler in this case my 'expirationHandler' block will be executed if execution time is over. By defining the block into a block variable one can recursively start the long running task again within the expiration handler. This leads into endless execution..

Lock-down iPhone/iPod/iPad so it can only run one app

http://stackoverflow.com/questions/5011774/lock-down-iphone-ipod-ipad-so-it-can-only-run-one-app

would have saved us a bit of hassle EDIT EDIT EDIT iOS 7 now includes an 'App Lock' payload as part of the device configuration profile. From the Apple docs By installing an app lock payload the device is locked to a single application until the payload is removed. The home button is disabled and the device returns to..

Understanding reference counting with Cocoa and Objective-C

http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c

the basic concepts. In Cocoa each object keeps track of how many times it is being referenced specifically the NSObject base class implements this . By calling retain on an object you are telling it that you want to up its reference count by one. By calling release you tell the object you are letting go of it and.. specifically the NSObject base class implements this . By calling retain on an object you are telling it that you want to up its reference count by one. By calling release you tell the object you are letting go of it and its reference count is decremented. If after calling release the reference count is now zero then.. then I need to make sure the object's reference count knows about me. As described above an object's reference count is incremented by calling retain . By convention it is also incremented set to 1 really when the object is created with an init method. In either of these cases it is my responsibility to call release..

Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working?

http://stackoverflow.com/questions/6901363/detecting-the-iphones-ring-silent-mute-switch-using-avaudioplayer-not-worki

was thinking maybe some other more accurate kAudioSessionProperty event is fired when the physical switch on the phone is ... switched. Anyone have any ideas By the way I'm using the AVAudioSessionCategoryAmbient category with my AVAudioSession sharedInstance . Update I've also tried using different audio categories and..

Lock Unlock events iphone

http://stackoverflow.com/questions/706344/lock-unlock-events-iphone

Unlock events iphone How can I detect lock unlock events on the iPhone Assuming it's only possible for jailbroken devices can you point me to the correct API By lock events I mean showing or hiding the Lock Screen which might need a password to unlock or not . iphone ios api locking share improve this question Round..

How to write data in plist?

http://stackoverflow.com/questions/905542/how-to-write-data-in-plist

have written some data within that directly without using coding . I am able to read that data but I cant able write through coding into the same save.plist. By using following code I am trying to write the data but it get stored within my .app plist. The code is here NSString errorDesc nil NSPropertyListFormat format NSString.. a bundled .plist here is some code NSString plistPath nil NSFileManager manager NSFileManager defaultManager if plistPath NSBundle mainBundle bundlePath stringByAppendingPathComponent @ Contents Info.plist if manager isWritableFileAtPath plistPath NSMutableDictionary infoDict NSMutableDictionary dictionaryWithContentsOfFile..

View Controllers: How to switch between views programmatically?

http://stackoverflow.com/questions/910994/view-controllers-how-to-switch-between-views-programmatically

from a nib. void viewDidLoad super viewDidLoad ViewControllerA vcA ViewControllerA alloc initWithNib self.contentView addSubview vcA.view cvA release By the way the initWithNib method looks like this id initWithNib Load the view nib if self super initWithNibName @ ViewA bundle nil do ivar initialization here if..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

the data size for example a screen sized PNG file might consume a few dozen KBs when compressed but consumes over half a MB decompressed width height 4 . By contrast imageWithContentsOfFile will decompress that image everytime the image data is needed. As you can imagine if you only need the image data once you've won.. CGImageGetWidth originalImage CGImageGetHeight originalImage CGImageGetBitsPerComponent originalImage CGImageGetBitsPerPixel originalImage CGImageGetBytesPerRow originalImage CGImageGetColorSpace originalImage CGImageGetBitmapInfo originalImage imageDataProvider CGImageGetDecode originalImage CGImageGetShouldInterpolate..

How to make a UITextField move up when keyboard is present

http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present

of the contents of the UIScrollView to see the other text fields once the keyboard is brought up Automatically jump by scrolling up or shortening I know that I need a UIScrollView . I've tried changing the class of my UIView to a UIScrollView.. I'd like to only write code for what needs it. Note the UIView or UIScrollView that I'm working with is brought up by a tabbar UITabBar which needs to function as normal. Edit I am adding the scroll bar just for when the keyboard comes up... the textfield scroll up when keyboard comes up then it's not needed. For showing the textfields without being hidden by the keyboard the standard way is to move up down the view having textfields whenever the keyboard is shown. Here is some..

How to detect iPhone 5 (widescreen devices)?

http://stackoverflow.com/questions/12446990/how-to-detect-iphone-5-widescreen-devices

of fabs with the epsilon is here to prevent precision errors when comparing floating points as pointed in the comments by H2CO3. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection As stated.. So from now on you can use it in standard if else statements if IS_IPHONE_5 else Edit Better detection As stated by some people this does only detect a widescreen not an actual iPhone 5. Next versions of the iPod touch will maybe also have.. and we can redefine the IS_IPHONE_5 macro #define IS_IPHONE_5 IS_IPHONE IS_WIDESCREEN Also note that as stated by @LearnCocos2D this macros won't work if the application is not optimised for the iPhone 5 screen missing the Default 568h@2x.png..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

that was generated as part of the build. I have all of these files together inside a single directory that is indexed by spotlight. What now I have tried invoking symbolicatecrash crashreport.crash myApp.app.dSYM and it just outputs the same..

How do I detect when someone shakes an iPhone?

http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone

return YES @end You can easily transform any UIView even system views into a view that can get the shake event simply by subclassing the view with only these methods and then selecting this new type instead of the base type in IB or using it..

How to force NSLocalizedString to use a specific language

http://stackoverflow.com/questions/1669645/how-to-force-nslocalizedstring-to-use-a-specific-language

settings for preferred languages are. This returns an array of language codes with the first one being the one set by the user for their phone and the subsequent ones used as fallbacks if a resource is not available in the preferred language... with a custom ordering in System Preferences You can override the global setting for your own application if you wish by using the setObject forKey method to set your own language list. This will take precedence over the globally set value and..

Programmatically get own phone number in iOS

http://stackoverflow.com/questions/193182/programmatically-get-own-phone-number-in-ios

get own phone number in iOS Is there any way to get own phone number by standard APIs from iPhone SDK iphone ios mobile phones phone number share improve this question At the risk of getting..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

functionality that is present in the iPhone SDK to access SOAP services Since the service I need to access is exposed by another party and they only expose it as SOAP it's unfortunately not an option to switch to another type of interface e.g...

How do I associate file types with an iPhone application?

http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application

that this is the same approach we used for handling custom URL schemes. You can separate the file URLs from others by using code like the following if url isFileURL Handle file being passed in else Handle custom URL scheme share improve..

How do I apply a perspective transform to a UIView?

http://stackoverflow.com/questions/347721/how-do-i-apply-a-perspective-transform-to-a-uiview

can be found here where I've implemented touch based rotation and scaling on a couple of CALayers based on an example by Bill Dudney. The newest version of the program at the very bottom of the page implements this kind of perspective operation...

Prefixing property names with an underscore in Objective C [duplicate]

http://stackoverflow.com/questions/3521254/prefixing-property-names-with-an-underscore-in-objective-c

the ivar as the property. You can optionally assign a different ivar in the @property declaration but the fact that by default synthesized accessors for a property will access the ivar with the same name as the property indicates that's the..

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints

When you can especially if they will be using memory beware of leaving contexts open though Recycle page objects by doing pointer swaps or destroy unused views Close any open Contexts as soon as you don't need them on receiving memory warnings..

How do I create delegates in Objective-C?

http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c

@selector something didFailWithError @end Then in the body we can check that our delegate handles messages by accessing our delegateRespondsTo struct rather than by sending respondsToSelector over and over again. share improve this..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

the same if a user uninstalls and re installs the app. iphone ios ipad share improve this question A UUID created by CFUUIDCreate is unique if a user uninstalls and re installs the app you will get a new one each time. But you might want.. best bet is with en0 . The MAC is always present even if the interface has no IP is down. Edit 2 As was pointed out by others the preferred solution since iOS 6 is UIDevice identifierForVendor . In most cases you should be able use it as a..

Full webpage and disabled zoom viewport meta tag for all mobile browsers

http://stackoverflow.com/questions/11345896/full-webpage-and-disabled-zoom-viewport-meta-tag-for-all-mobile-browsers

will work on different browsers. Android 2.2 viewport meta tag does not seem to be supported at all. Android 2.3.x 3.x By setting user scalable no you disable the scaling of the viewport meta tag yourself as well. This is probably why your width..

Autorotate in iOS 6 has strange behaviour

http://stackoverflow.com/questions/12526054/autorotate-in-ios-6-has-strange-behaviour

containers such as UINavigationController do not consult their children to determine whether they should autorotate. By default an app and a view controller ™s supported interface orientations are set to UIInterfaceOrientationMaskAll for the..

Symbolicating iPhone App Crash Reports

http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports

app. In this case we don't need .dSYM file. Note This can only work if the app binary does not have symbols stripped. By default release builds stripped the symbols. We can change it in project build settings Strip Debug Symbols During Copy..

Changing my CALayer's anchorPoint moves the view

http://stackoverflow.com/questions/1968017/changing-my-calayers-anchorpoint-moves-the-view

properties. Basically the position of a layer is specified in terms of the location of the layer's anchorPoint. By default a layer's anchorPoint is 0.5 0.5 which lies at the center of the layer. When you set the position of the layer you..

Send and receive messages through NSNotificationCenter in Objective-C? [closed]

http://stackoverflow.com/questions/2191594/send-and-receive-messages-through-nsnotificationcenter-in-objective-c

the notification center to inform us of TestNotification notifications using the receiveTestNotification selector. By specifying object nil we tell the notification center that we are not interested in who posted the notification. If you..

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

having a class of UIViewController instead 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..

Can I make POST or GET requests from an iphone application?

http://stackoverflow.com/questions/319463/can-i-make-post-or-get-requests-from-an-iphone-application

NSURLConnection connection Once this method is invoked responseData contains the complete result This will send a GET. By the time the final method is called responseData will contain the entire HTTP response convert to string with NSString alloc..

How do I reset after a UIScrollView zoom?

http://stackoverflow.com/questions/448285/how-do-i-reset-after-a-uiscrollview-zoom

manually redraw view at new scale here contentView.previousScale scale scrollView.contentSize contentView.frame.size By doing this the transforms sent to the content view are adjusted based on the scale at which the view was last redrawn. When..

iPhone - Backgrounding to poll for events

http://stackoverflow.com/questions/4656214/iphone-backgrounding-to-poll-for-events

the expiration handler in this case my 'expirationHandler' block will be executed if execution time is over. By defining the block into a block variable one can recursively start the long running task again within the expiration handler...

Lock-down iPhone/iPod/iPad so it can only run one app

http://stackoverflow.com/questions/5011774/lock-down-iphone-ipod-ipad-so-it-can-only-run-one-app

EDIT EDIT iOS 7 now includes an 'App Lock' payload as part of the device configuration profile. From the Apple docs By installing an app lock payload the device is locked to a single application until the payload is removed. The home button..

Understanding reference counting with Cocoa and Objective-C

http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c

object keeps track of how many times it is being referenced specifically the NSObject base class implements this . By calling retain on an object you are telling it that you want to up its reference count by one. By calling release you tell.. implements this . By calling retain on an object you are telling it that you want to up its reference count by one. By calling release you tell the object you are letting go of it and its reference count is decremented. If after calling release.. reference count knows about me. As described above an object's reference count is incremented by calling retain . By convention it is also incremented set to 1 really when the object is created with an init method. In either of these cases..

Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working?

http://stackoverflow.com/questions/6901363/detecting-the-iphones-ring-silent-mute-switch-using-avaudioplayer-not-worki

kAudioSessionProperty event is fired when the physical switch on the phone is ... switched. Anyone have any ideas By the way I'm using the AVAudioSessionCategoryAmbient category with my AVAudioSession sharedInstance . Update I've also tried..

Lock Unlock events iphone

http://stackoverflow.com/questions/706344/lock-unlock-events-iphone

unlock events on the iPhone Assuming it's only possible for jailbroken devices can you point me to the correct API By lock events I mean showing or hiding the Lock Screen which might need a password to unlock or not . iphone ios api locking..

How to write data in plist?

http://stackoverflow.com/questions/905542/how-to-write-data-in-plist

without using coding . I am able to read that data but I cant able write through coding into the same save.plist. By using following code I am trying to write the data but it get stored within my .app plist. The code is here NSString errorDesc.. plistPath nil NSFileManager manager NSFileManager defaultManager if plistPath NSBundle mainBundle bundlePath stringByAppendingPathComponent @ Contents Info.plist if manager isWritableFileAtPath plistPath NSMutableDictionary infoDict NSMutableDictionary..

View Controllers: How to switch between views programmatically?

http://stackoverflow.com/questions/910994/view-controllers-how-to-switch-between-views-programmatically

viewDidLoad ViewControllerA vcA ViewControllerA alloc initWithNib self.contentView addSubview vcA.view cvA release By the way the initWithNib method looks like this id initWithNib Load the view nib if self super initWithNibName @ ViewA bundle..

Dispelling the UIImage imageNamed: FUD

http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud

sized PNG file might consume a few dozen KBs when compressed but consumes over half a MB decompressed width height 4 . By contrast imageWithContentsOfFile will decompress that image everytime the image data is needed. As you can imagine if you.. CGImageGetHeight originalImage CGImageGetBitsPerComponent originalImage CGImageGetBitsPerPixel originalImage CGImageGetBytesPerRow originalImage CGImageGetColorSpace originalImage CGImageGetBitmapInfo originalImage imageDataProvider CGImageGetDecode..

How do I start playing audio when in silent mode & locked in iOS 6?

http://stackoverflow.com/questions/9725192/how-do-i-start-playing-audio-when-in-silent-mode-locked-in-ios-6

but not in the BG. Which is what I need Also When you ask how much time you have left running you get aprox 10 min. By dropping an infinite loop in there the numbers will actually run down to 0 and then go into the negatives for hours on end...

how to get the message when receiving the “kCTMessageReceivedNotification” notification on IOS5

http://stackoverflow.com/questions/10681995/how-to-get-the-message-when-receiving-the-kctmessagereceivednotification-notif

iOS 4 and 5 may require different SQL as the .db format may change const char sql4 SELECT text from message ORDER BY rowid DESC TODO different for iOS 4. const char sql5 SELECT text from message ORDER BY rowid DESC NSString osVersion UIDevice.. SELECT text from message ORDER BY rowid DESC TODO different for iOS 4. const char sql5 SELECT text from message ORDER BY rowid DESC NSString osVersion UIDevice currentDevice systemVersion if osVersion hasPrefix @ 5 iOS 5. tested sqlite3_prepare_v2..

iPhone CoreData - How to fetch managed objects, and sorting them ignoring case?

http://stackoverflow.com/questions/2013158/iphone-coredata-how-to-fetch-managed-objects-and-sorting-them-ignoring-case

of a simple query ignoring case. Your suggestion applies for searching and comparing. SQL speaking I need a ORDER BY firstName ASC and this comand must be case insensitive for my usage. I have done some Googling and I ended reading the NSSortDescriptor..

Retrieving a unique result set with Core Data

http://stackoverflow.com/questions/2656227/retrieving-a-unique-result-set-with-core-data

them returned in order according to rank. So in SQL what I'm looking for is the following SELECT DISTINCT type ORDER BY rank ASC Here is the code I have so far that's breaking NSError error NULL NSFetchRequest fetchRequest NSFetchRequest alloc..

Find the tangent of a point on a cubic bezier curve (on an iPhone)

http://stackoverflow.com/questions/4089443/find-the-tangent-of-a-point-on-a-cubic-bezier-curve-on-an-iphone

routines you need for the calculation and nothing else. Hope this helps someone in the future. MBBezierView.m original BY MICHAL stackoverflow #4058979 #import MBBezierView.h CGFloat bezierInterpolation CGFloat t CGFloat a CGFloat b CGFloat c..

Tap pressure strength detection using accelerometer

http://stackoverflow.com/questions/5179426/tap-pressure-strength-detection-using-accelerometer

disclaimer in the documentation and or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY.. disclaimer in the documentation and or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY..

Facebook FQL multiquery in iOS SDK

http://stackoverflow.com/questions/6022522/facebook-fql-multiquery-in-ios-sdk

name hometown_location from user where uid IN SELECT uid2 FROM friend WHERE uid1 lld and hometown_location '' ORDER BY rand limit 4 facebookId Create a params dictionary NSMutableDictionary params NSMutableDictionary dictionaryWithObject fql..

How do I send data from SQLite database in iPhone app to Web Service?

http://stackoverflow.com/questions/6836022/how-do-i-send-data-from-sqlite-database-in-iphone-app-to-web-service

and add them to the app database. I'll get the most recent record id using this query SELECT id FROM MainTable ORDER BY id DESC LIMIT 1. But how do I then send the result to the php page to compare to the web database php iphone mysql web..

Sort the date in Sqlite database

http://stackoverflow.com/questions/7161313/sort-the-date-in-sqlite-database

save in the a SQLite database. With an simple SQL query you can then select the sort then SELECT FROM dateTable ORDER BY myDateColumn DESC And to get the NSDate back just NSDate date NSDate dateWithTimeIntervalSince1970 databaseTimeInterval..

Subquery in SQLite query not working

http://stackoverflow.com/questions/843604/subquery-in-sqlite-query-not-working

AS node line_items AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.name 'Power Up' GROUP BY node.name ORDER BY node.lft AS sub_tree WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.lft BETWEEN sub_parent.lft.. AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.name 'Power Up' GROUP BY node.name ORDER BY node.lft AS sub_tree WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.lft BETWEEN sub_parent.lft AND sub_parent.rgt.. AND parent.rgt AND node.lft BETWEEN sub_parent.lft AND sub_parent.rgt AND sub_parent.name sub_tree.name GROUP BY node.name HAVING depth 1 ORDER BY node.lft SQLite reports that sub_tree.name isn't a column and I assume this is because..

Populate the table view sections with rows of table in sqlite database in an order

http://stackoverflow.com/questions/8475446/populate-the-table-view-sections-with-rows-of-table-in-sqlite-database-in-an-ord

sqlite3_open dbpath remindersDB SQLITE_OK NSString querySQL NSString stringWithFormat @ SELECT from reminders ORDER BY id const char query_stmt querySQL UTF8String if sqlite3_prepare_v2 self.remindersDB query_stmt 1 statement NULL SQLITE_OK..

Get selected value of a picker view that is present in different view and use the string in some other view

http://stackoverflow.com/questions/8708543/get-selected-value-of-a-picker-view-that-is-present-in-different-view-and-use-th

friends using the query NSString getQuery NSString stringWithFormat @ SELECT FROM reminders WHERE Grp 'Friends' GROUP BY Name Event Date Like wise for group family office and acquaintances.Hence for shifting the context of bad programming to.. an idea of using the query NSString getQuery NSString stringWithFormat @ SELECT FROM reminders WHERE Grp ' @' GROUP BY Name Event Date selected string value from the picker in previous view Please identify the change I am trying to do i.e...

Distinct Count via Core Data, NSExpression Into NSFetchedResultsController

http://stackoverflow.com/questions/9157436/distinct-count-via-core-data-nsexpression-into-nsfetchedresultscontroller

. I have one table in which I am trying to retrieve information along these lines SELECT item COUNT FROM myTable GROUP BY item in order to produce this type of result item COUNT group 1 2 group 2 5 group 3 8 I had the bright idea to use.. 31 15 17 42.160 Scratch 16084 10d03 CoreData sql SELECT t0.ZEMAILADDRESS COUNT t0.ZEMAILADDRESS FROM ZPERSON t0 GROUP BY t0.ZEMAILADDRESS 2012 05 31 15 17 42.162 Scratch 16084 10d03 CoreData annotation sql connection fetch time 0.0024s 2012..