¡@

Home 

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

iphone Programming Glossary: rather

When should I release objects in -(void)viewDidUnload rather than in -dealloc?

http://stackoverflow.com/questions/1158788/when-should-i-release-objects-in-voidviewdidunload-rather-than-in-dealloc

should I release objects in void viewDidUnload rather than in dealloc What is the void viewDidUnload is good for Could I not just relase everything in dealloc..

How to convert NSArray to NSData?

http://stackoverflow.com/questions/1286212/how-to-convert-nsarray-to-nsdata

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 that we are not interested in who posted the notification. If you provided an actual object rather than nil the notification center will only notify you when the notification was posted by that particular..

Objective-C - When to use 'self'

http://stackoverflow.com/questions/2385980/objective-c-when-to-use-self

share improve this question Using self causes your class' setter for this variable to be called rather than changing the ivar directly. self.mainViewController aController is equivalent to self setMainViewController..

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

http://stackoverflow.com/questions/2496554/easiest-way-to-support-multiple-orientations-how-do-i-load-a-custom-nib-when-th

you push your view inside of this function The orientation constants are not globals you query but rather part of the messages sent the controller by the system. As such you cannot easily detect orientation..

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

9770ACFA 0B88 41D4 AF56 77B66B324640 Test.app TEST As the App is built programmatically rather than using XIB's I've split the 2 device logics using the following lines in the main.m method if UI_USER_INTERFACE_IDIOM..

underline text in UIlabel

http://stackoverflow.com/questions/2711297/underline-text-in-uilabel

If you still wish to support iOS 4 and iOS 5 I'd recommend to use TTTAttributedLabel rather than underline label manually. However if you need to underline one line UILabel and don't want to use..

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

#define DebugLog s ... #endif I found it easier to put this entire statement in the prefix header rather than its own file. You could if you wanted build a more complicated logging system by having DebugLog..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

A Single UILabel How would it be possible to include both bold and non bold text in a uiLabel I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

In essence to get the subpaths to subtract when you add them together you need to draw them or rather construct them in opposite directions one clockwise and the other anti clockwise. Then you need to set..

Customizing UIAlertView

http://stackoverflow.com/questions/551530/customizing-uialertview

object I don't care about the textfield it's the buttons in a grid I want preferably with images rather than text . iphone uialertview share improve this question I think your best bet is to forget customizing..

How do I create delegates in Objective-C?

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

Locking the Fields in MFMailComposeViewController

http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller

the previous view. Basically I think it would just be more professional to have the fields locked rather than display an alert or something saying Please Don't Edit the Message so its not a massive problem..

How do I get a background location update every n minutes in my iOS application?

http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application

to finish some work in the background also limited in time when an app is moved to the background rather than implementing long running background processes. How can I implement these regular background location..

Understanding reference counting with Cocoa and Objective-C

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

comfortable with C's malloc and free concept but Cocoa's references counting scheme has me rather confused. I'm told it's very elegant once you understand it but I'm just not over the hump yet. How..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

Guide but I am concerned that it might not be the best approach because it focuses on 2.0 rather than 1.x. My understanding is that 2.0 is not backwards compatible with 1.x so I may miss out on some..

iOS Launching Settings -> Restrictions URL Scheme

http://stackoverflow.com/questions/8246070/ios-launching-settings-restrictions-url-scheme

would be greatly appreciated. I'm trying to take the user to enable in app purchasing and would rather not have the user manually click on Restrictions not very obvious . Thanks iphone ios settings url..

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

and restating the rules for new programmers with ARC it is becoming a more advanced topic. I'd rather get new developers thinking in terms of object graphs rather than fill their heads with the underlying..

Is there any ready-made calendar control for iPhone apps?

http://stackoverflow.com/questions/997779/is-there-any-ready-made-calendar-control-for-iphone-apps

so does anyone know of a third party control that could be used I could write one myself but I'd rather pick up something ready since this is a departure on the original project plans . iphone cocoa touch..

When should I release objects in -(void)viewDidUnload rather than in -dealloc?

http://stackoverflow.com/questions/1158788/when-should-i-release-objects-in-voidviewdidunload-rather-than-in-dealloc

should I release objects in void viewDidUnload rather than in dealloc What is the void viewDidUnload is good for Could I not just relase everything in dealloc If the view did unload wouldn't dealloc be called anyway..

How to convert NSArray to NSData?

http://stackoverflow.com/questions/1286212/how-to-convert-nsarray-to-nsdata

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

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

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 the notification center will only notify you when the notification was posted by that particular object. NSNotificationCenter defaultCenter addObserver..

Objective-C - When to use 'self'

http://stackoverflow.com/questions/2385980/objective-c-when-to-use-self

same instance variable. iphone objective c cocoa touch share improve this question Using self causes your class' setter for this variable to be called rather than changing the ivar directly. self.mainViewController aController is equivalent to self setMainViewController aController On the other hand mainViewController..

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

http://stackoverflow.com/questions/2496554/easiest-way-to-support-multiple-orientations-how-do-i-load-a-custom-nib-when-th

but will this be called when the app launches Do you push your view inside of this function The orientation constants are not globals you query but rather part of the messages sent the controller by the system. As such you cannot easily detect orientation before a view controller loads. Instead you hardwire the app..

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

Library Frameworks UIKit.framework UIKit in var mobile Applications 9770ACFA 0B88 41D4 AF56 77B66B324640 Test.app TEST As the App is built programmatically rather than using XIB's I've split the 2 device logics using the following lines in the main.m method if UI_USER_INTERFACE_IDIOM UIUserInterfaceIdiomPad retVal UIApplicationMain..

underline text in UIlabel

http://stackoverflow.com/questions/2711297/underline-text-in-uilabel

alloc initWithString @ Test string attributes underlineAttribute If you still wish to support iOS 4 and iOS 5 I'd recommend to use TTTAttributedLabel rather than underline label manually. However if you need to underline one line UILabel and don't want to use third party components code above would still do the trick...

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

__LINE__ NSString stringWithFormat s ##__VA_ARGS__ #else #define DebugLog s ... #endif I found it easier to put this entire statement in the prefix header rather than its own file. You could if you wanted build a more complicated logging system by having DebugLog interact with normal Objective C objects. For instance you..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

Non Bold Text In A Single UILabel How would it be possible to include both bold and non bold text in a uiLabel I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea how to use that. Any ideas Apple achieves this in several..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

winding of even odd depending on how you created these paths. In essence to get the subpaths to subtract when you add them together you need to draw them or rather construct them in opposite directions one clockwise and the other anti clockwise. Then you need to set your visible path as the clipping path on the context so..

Customizing UIAlertView

http://stackoverflow.com/questions/551530/customizing-uialertview

yet a 3x2 grid of buttons with images using the UIAlertView object I don't care about the textfield it's the buttons in a grid I want preferably with images rather than text . iphone uialertview share improve this question I think your best bet is to forget customizing UIAlert view and build a custom view yourself. For..

How do I create delegates in Objective-C?

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

Locking the Fields in MFMailComposeViewController

http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller

data that the user inputs to textfields and date pickers in the previous view. Basically I think it would just be more professional to have the fields locked rather than display an alert or something saying Please Don't Edit the Message so its not a massive problem if the fields can't be locked but any help would be greatly..

How do I get a background location update every n minutes in my iOS application?

http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application

As far as I understand this should be used to finish some work in the background also limited in time when an app is moved to the background rather than implementing long running background processes. How can I implement these regular background location updates iphone ios objective c core location background..

Understanding reference counting with Cocoa and Objective-C

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

Cocoa with a view to playing with the iPhone SDK. I'm reasonably comfortable with C's malloc and free concept but Cocoa's references counting scheme has me rather confused. I'm told it's very elegant once you understand it but I'm just not over the hump yet. How do release retain and autorelease work and what are the conventions..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

platforms as well. I've found the book OpenGL ES 2.0 Programming Guide but I am concerned that it might not be the best approach because it focuses on 2.0 rather than 1.x. My understanding is that 2.0 is not backwards compatible with 1.x so I may miss out on some important concepts. Note For answers about learning general..

iOS Launching Settings -> Restrictions URL Scheme

http://stackoverflow.com/questions/8246070/ios-launching-settings-restrictions-url-scheme

on this or been able to make this work Any insight would be greatly appreciated. I'm trying to take the user to enable in app purchasing and would rather not have the user manually click on Restrictions not very obvious . Thanks iphone ios settings url scheme share improve this question WARNING This method will..

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

Is there any ready-made calendar control for iPhone apps?

http://stackoverflow.com/questions/997779/is-there-any-ready-made-calendar-control-for-iphone-apps

there is nothing like that out of the box. Is that true If so does anyone know of a third party control that could be used I could write one myself but I'd rather pick up something ready since this is a departure on the original project plans . iphone cocoa touch interface uikit calendar share improve this question Yes...

When should I release objects in -(void)viewDidUnload rather than in -dealloc?

http://stackoverflow.com/questions/1158788/when-should-i-release-objects-in-voidviewdidunload-rather-than-in-dealloc

should I release objects in void viewDidUnload rather than in dealloc What is the void viewDidUnload is good for Could I not just relase everything in dealloc If the view did..

How to convert NSArray to NSData?

http://stackoverflow.com/questions/1286212/how-to-convert-nsarray-to-nsdata

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 that we are not interested in who posted the notification. If you provided an actual object rather than nil the notification center will only notify you when the notification was posted by that particular object. NSNotificationCenter..

Objective-C - When to use 'self'

http://stackoverflow.com/questions/2385980/objective-c-when-to-use-self

c cocoa touch share improve this question Using self causes your class' setter for this variable to be called rather than changing the ivar directly. self.mainViewController aController is equivalent to self setMainViewController aController..

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

http://stackoverflow.com/questions/2496554/easiest-way-to-support-multiple-orientations-how-do-i-load-a-custom-nib-when-th

the app launches Do you push your view inside of this function The orientation constants are not globals you query but rather part of the messages sent the controller by the system. As such you cannot easily detect orientation before a view controller..

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

in var mobile Applications 9770ACFA 0B88 41D4 AF56 77B66B324640 Test.app TEST As the App is built programmatically rather than using XIB's I've split the 2 device logics using the following lines in the main.m method if UI_USER_INTERFACE_IDIOM..

underline text in UIlabel

http://stackoverflow.com/questions/2711297/underline-text-in-uilabel

attributes underlineAttribute If you still wish to support iOS 4 and iOS 5 I'd recommend to use TTTAttributedLabel rather than underline label manually. However if you need to underline one line UILabel and don't want to use third party components..

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

##__VA_ARGS__ #else #define DebugLog s ... #endif I found it easier to put this entire statement in the prefix header rather than its own file. You could if you wanted build a more complicated logging system by having DebugLog interact with normal..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

Non Bold Text In A Single UILabel How would it be possible to include both bold and non bold text in a uiLabel I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea how to use that. Any..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

created these paths. In essence to get the subpaths to subtract when you add them together you need to draw them or rather construct them in opposite directions one clockwise and the other anti clockwise. Then you need to set your visible path..

Customizing UIAlertView

http://stackoverflow.com/questions/551530/customizing-uialertview

using the UIAlertView object I don't care about the textfield it's the buttons in a grid I want preferably with images rather than text . iphone uialertview share improve this question I think your best bet is to forget customizing UIAlert view..

How do I create delegates in Objective-C?

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

Locking the Fields in MFMailComposeViewController

http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller

and date pickers in the previous view. Basically I think it would just be more professional to have the fields locked rather than display an alert or something saying Please Don't Edit the Message so its not a massive problem if the fields can't..

How do I get a background location update every n minutes in my iOS application?

http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application

this should be used to finish some work in the background also limited in time when an app is moved to the background rather than implementing long running background processes. How can I implement these regular background location updates iphone..

Understanding reference counting with Cocoa and Objective-C

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

iPhone SDK. I'm reasonably comfortable with C's malloc and free concept but Cocoa's references counting scheme has me rather confused. I'm told it's very elegant once you understand it but I'm just not over the hump yet. How do release retain and..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

OpenGL ES 2.0 Programming Guide but I am concerned that it might not be the best approach because it focuses on 2.0 rather than 1.x. My understanding is that 2.0 is not backwards compatible with 1.x so I may miss out on some important concepts...

iOS Launching Settings -> Restrictions URL Scheme

http://stackoverflow.com/questions/8246070/ios-launching-settings-restrictions-url-scheme

this work Any insight would be greatly appreciated. I'm trying to take the user to enable in app purchasing and would rather not have the user manually click on Restrictions not very obvious . Thanks iphone ios settings url scheme share improve..

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

time stating and restating the rules for new programmers with ARC it is becoming a more advanced topic. I'd rather get new developers thinking in terms of object graphs rather than fill their heads with the underlying calls to objc_retain..

Is there any ready-made calendar control for iPhone apps?

http://stackoverflow.com/questions/997779/is-there-any-ready-made-calendar-control-for-iphone-apps

box. Is that true If so does anyone know of a third party control that could be used I could write one myself but I'd rather pick up something ready since this is a departure on the original project plans . iphone cocoa touch interface uikit calendar..

Creating 16:9 Video Rather than 4:3 - AVAsset Writer - iPhone

http://stackoverflow.com/questions/10358086/creating-169-video-rather-than-43-avasset-writer-iphone

16 9 Video Rather than 4 3 AVAsset Writer iPhone I am using the below code to make a video from a static 16 9 image using AVAsset writer...

Cocoa Touch: When does an NSFetchedResultsController become necessary to manage a Core Data fetch?

http://stackoverflow.com/questions/1263723/cocoa-touch-when-does-an-nsfetchedresultscontroller-become-necessary-to-manage

significantly reduced the amount of code I had to write. Performance wise it can lead to a huge improvement as well. Rather than fetching in your entire data set if you use setFetchBatchSize with the NSFetchRequest that you feed into the NSFetchedResultsController..

How can a superview interecept a touch sequence before any of its subviews?

http://stackoverflow.com/questions/1673903/how-can-a-superview-interecept-a-touch-sequence-before-any-of-its-subviews

property is NO the scroll view does not scroll regardless of finger movement once the content view starts tracking. Rather opaque huh Anyway it seems to work. iphone cocoa touch uiscrollview subview share improve this question To stop the..

Drawing incrementally in a UIView (iPhone)

http://stackoverflow.com/questions/1798414/drawing-incrementally-in-a-uiview-iphone

of the UIView's content every time you draw and the rest of the content generally stays the same you can use this. Rather than redraw all the content of the UIView every single time you can mark only the areas of the view that need redrawing..

Resizing UINavigationBar on rotation

http://stackoverflow.com/questions/1826011/resizing-uinavigationbar-on-rotation

read the answer posted below. iphone rotation uinavigationbar landscape autoresize share improve this question Rather than set it's autoresizing mask why don't you just check the current orientation in viewWillAppear as well as in didRotateFromInterfaceOrientation..

Max payload size for http request and response, iphone

http://stackoverflow.com/questions/1988375/max-payload-size-for-http-request-and-response-iphone

on downloads but I suspect uploads would have the same limit and you will also run into this as you pull down images. Rather than write this yourself there is a great lib out there that handles http requests with attachments no I am not the author..

Javascript widget inspired by iPhone UITableView?

http://stackoverflow.com/questions/3258486/javascript-widget-inspired-by-iphone-uitableview

allows a user to scroll through large numbers of data rows with good performance because it recycles table rows. Rather than create a GUI element for every single data row a limited number of table rows is created and simply updated with the..

How do I test if IOS device has telephone capabilities?

http://stackoverflow.com/questions/3736110/how-do-i-test-if-ios-device-has-telephone-capabilities

support in my app at the press of a button for iPhone users and display a phone number for iPad iPod Touch users. Rather than detecting what device the user has is there a better way to query the hardware to see if it has telephony capabilities..

UINavigationController and presenting a modal controller

http://stackoverflow.com/questions/5660685/uinavigationcontroller-and-presenting-a-modal-controller

In App Purchase user cancels tx while app in background: tx state stays on purchasing

http://stackoverflow.com/questions/6311116/in-app-purchase-user-cancels-tx-while-app-in-background-tx-state-stays-on-purch

storekit share improve this question I don't believe you can count on ANYTHING when it comes to Store Kit. Rather than waiting expectantly for the transaction to be queued after the Buy button is pressed just go on about your business...

Is there a way to pass touches through on the iPhone?

http://stackoverflow.com/questions/631427/is-there-a-way-to-pass-touches-through-on-the-iphone

something like this based on the type of touch of course self.nextResponder touchesBegan touches withEvent event Rather than disposing of the touch event it is passed on. Sub classed UIButton MyButton.h #import Foundation Foundation.h @interface..

Choosing between the two - Interface Builder OR creating via code

http://stackoverflow.com/questions/6385516/choosing-between-the-two-interface-builder-or-creating-via-code

inherently a visual task . Interface Builder can allow you to create and modify a UI much faster than you can in code. Rather than endlessly tweaking CGRect values in code then recompiling testing and repeating this process you can instead get direct..

Two views Multiple UIPickerViews Single outlet

http://stackoverflow.com/questions/6704357/two-views-multiple-uipickerviews-single-outlet

returns the picker view for the current orientation. @property nonatomic retain readonly UIPickerView pickerView Rather than synthesizing this property you could implement it like this UIPickerView pickerView if self.landscapeView.superview..

how to display UIActivityIndicatorView BEFORE rotation begins

http://stackoverflow.com/questions/7041261/how-to-display-uiactivityindicatorview-before-rotation-begins

first rotation i.e. before I have cached data when working with a large file there can be a noticeable delay. Rather than re architect my app to cope with this uncommon case I'd rather just show the UIActivityIndicatorView while the app..

iOS post to the Facebook app wall

http://stackoverflow.com/questions/7495472/ios-post-to-the-facebook-app-wall

wall I am wondering if it is possible to post to the wall of the Facebook app page created for using Facebook in iOS. Rather than use the user login to post to their own wall I would like to post to the app's page with updates on open games. Is..

Responsive website on iPhone - unwanted white space on rotate from landscape to portrait

http://stackoverflow.com/questions/8004707/responsive-website-on-iphone-unwanted-white-space-on-rotate-from-landscape-to

hand side. This white space also seems to be present on first loading in portrait as the user can swipe the page left Rather than complicating the explanation any further here's a link to a sample page where this behaviour is occurring . Have a..

How can I link to my app in the App Store (iTunes)?

http://stackoverflow.com/questions/818973/how-can-i-link-to-my-app-in-the-app-store-itunes

the iTunes URL to my application. How is it possible Thanks. iphone ios app store share improve this question Rather than the long and confusing urls that you usually see you can create App Store links that are much simpler and more logical...

AVPlayerItem fails with AVStatusFailed and error code “Cannot Decode”

http://stackoverflow.com/questions/8608570/avplayeritem-fails-with-avstatusfailed-and-error-code-cannot-decode

player you will get the cannot decode error. It is not a limit on the number of instances of AVPlayer or AVPlayerItem. Rather it is the association of AVPlayerItem with an AVPlayer which creates a render pipeline and you are limited to 4 of these...

Is there an advantage to using blocks over functions in Objective-C?

http://stackoverflow.com/questions/8647462/is-there-an-advantage-to-using-blocks-over-functions-in-objective-c

method implementation. Blocks are thus often parameters of framework methods. They allow access to local variables. Rather than using callbacks requiring a data structure that embodies all the contextual information you need to perform an operation..

Why does clearing NSUserDefaults cause EXC_CRASH later when creating a UIWebView?

http://stackoverflow.com/questions/9679163/why-does-clearing-nsuserdefaults-cause-exc-crash-later-when-creating-a-uiwebview

going on. When a user logs out of my app one of the things that happens is that all of the NSUserDefaults get deleted. Rather than manually removing every key I might add to the user's defaults I just completely delete all of the NSUserDefaults using..