tagged [cocoa-touch]

Generate a UUID on iOS from Swift

Generate a UUID on iOS from Swift In my iOS Swift app I want to generate random UUID () strings for use as a table key, and this snippet to work: Is this safe? Or is there perhaps a better (recommende...

NSString property: copy or retain?

NSString property: copy or retain? Let's say I have a class called `SomeClass` with a `string` property name: I understand that name may be assigned a `NSMutableString` in which case this may lead to ...

30 Sep at 09:25

"Unknown class <MyClass> in Interface Builder file" error at runtime

"Unknown class in Interface Builder file" error at runtime Even though Interface Builder is aware of a `MyClass`, I get an error when starting the application. This happens when `MyClass` is part of a...

How can we programmatically detect which iOS version is device running on?

How can we programmatically detect which iOS version is device running on? I want to check if the user is running the app on iOS less than 5.0 and display a label in the app. How do I detect which iOS...

Hide separator line on one UITableViewCell

Hide separator line on one UITableViewCell I'm customizing a `UITableView`. I want to hide the line separating on the cell ... can i do this? I know I can do `tableView.separatorStyle = UITableViewCel...

Launch an app from within another (iPhone)

Launch an app from within another (iPhone) Is it possible to launch any arbitrary iPhone application from within another app?, . would this be possible? I know this can be done for making phone calls ...

UILabel text margin

UILabel text margin I'm looking to set the left inset/margin of a `UILabel` and can't find a method to do so. The label has a background set so just changing its origin won't do the trick. It would be...

22 Dec at 11:54

How do you dismiss the keyboard when editing a UITextField

How do you dismiss the keyboard when editing a UITextField I know that I need to tell my UITextField to resign first responder when I want to dismis the keyboard, but I'm not sure how to know when the...

How to show the loading indicator in the top status bar

How to show the loading indicator in the top status bar I have noticed that some apps like Safari and Mail show a loading indicator in the status bar (the bar at the very top of the phone) when they a...

8 Jan at 08:56

Build Error - missing required architecture i386 in file

Build Error - missing required architecture i386 in file I'm getting this error when building my iPhone application: > ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1...

14 Mar at 13:24

How to get the screen width and height in iOS?

How to get the screen width and height in iOS? How can one get the dimensions of the screen in iOS? Currently, I use: in `viewWillAppear:` and `willAnimateRotationToInterfaceOrientation:duration:` The...

15 Apr at 14:58

When should i release this object?

When should i release this object? ``` - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { CGRect imageFrame = ...

8 Oct at 03:42

Does it matter to have an class without members?

Does it matter to have an class without members? I have a class with only class methods (utility stuff), so my interface is like: Xcode doesn't like it and says: > warning: struct has no named members...

4 Sep at 08:21

MKAnnotationView image property

MKAnnotationView image property I have an `MKAnnotationView` (`draggable` property is set to `YES`) with a custom image, set via the `image` property. When the annotation is added to the map it has th...

12 Feb at 15:3

Easy way to dismiss keyboard?

Easy way to dismiss keyboard? I have quite a few controls scattered throughout many table cells in my table, and I was wondering if there's an easier way to dismiss the keyboard without having to loop...

7 Aug at 13:48

How to embed small icon in UILabel

How to embed small icon in UILabel I need to embed small icons ( sort of custom bullets ) to my `UILabel` in iOS7. How can I do this in interface designer? Or at least in code? In Android there are `l...

How to customize the background color of a UITableViewCell?

How to customize the background color of a UITableViewCell? I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not ...

How to tell which MKPinAnnotation has been pressed?

How to tell which MKPinAnnotation has been pressed? i have an `MKMapView` and have a whole bunch of `MKPinAnnotations` being shown and all of them have call out feature which shows a more detail view ...

12 Aug at 18:24

Core Data and Core Location

Core Data and Core Location I have a Core Data database with latitude and longitude properties. Is there a way to use Core Location's `getDistanceFrom:` method to find the five nearest locations to a ...

Is "English" or "en" the preferred .lproj folder name now?

Is "English" or "en" the preferred .lproj folder name now? In Apple's documentation and example code, I see lproj folders both named with the name of the language, such as "English", and with an ISO 6...

What is the right way to check for a null string in Objective-C?

What is the right way to check for a null string in Objective-C? I was using this in my iPhone app but it throws some exception, and the console shows that the title is "(null)". So I'm using this now...

25 Feb at 07:18

-didSelectRowAtIndexPath: not being called

-didSelectRowAtIndexPath: not being called I'm writing an iOS app with a table view inside a tab view. In my `UITableViewController`, I implemented `-tableView:didSelectRowAtIndexPath:`, but when I se...

Cocoahttpserver serving images from iPhone App Bundle

Cocoahttpserver serving images from iPhone App Bundle I am having trouble getting Cocoahttpserver from Duesty Designs (awesome open source library makers of CocoaAsyncSocket) to serve images from my a...

UIFont with a custom leading?

UIFont with a custom leading? I would like to use the system font but with a custom leading, but the leading property of a UIFont is readonly. Is there a way to create a system font with a custom lead...

23 Mar at 14:23

Navigation bar show/hide

Navigation bar show/hide I have an app with a navigation bar consisting of 2 bar buttons. I would like to hide and show this navigation bar when a user double taps the screen. Initially, the navigatio...