Questions tagged [cocoa-touch]

The Cocoa Touch Frameworks that drive iOS apps share many proven patterns found on the Mac, but were built with a special focus on touch-based interfaces and optimization.

Cocoa Touch is Apple's application-development framework for , consisting of Foundation, UIKit (), and Core Data ().

The Cocoa Touch frameworks that drive apps share many proven patterns found on the , but were built with a special focus on touch-based interfaces and optimization.

For development, see .

For Cocoapods, see .

Many Cocoa Touch questions deal with , , , or .

Debugging techniques

Cocoa programs can be debugged with many techniques and tools, both general and specific to , , , and .

Apple's Technical Note about debugging iOS applications

34585 questions
19
votes
4 answers

Debug WatchKit on real Apple Watch - Nothing happens

I am struggling with debugging my WatchKit Extension/App on a real Apple Watch. Debugging both the iPhone App and the WatchKit Extension using the simulator the simulator is not problem: Select the WatchKit App Profile and run in Simulator ==> App…
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
19
votes
1 answer

How to cancel on-going HTTP request in Swift?

My code does GET request like this: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { () -> Void in // ... let task = NSURLSession.sharedSession().dataTaskWithRequest(request) { data, response, error in …
Joon. P
  • 2,238
  • 7
  • 26
  • 53
19
votes
5 answers

iPhone SDK 4 "Half curl page transition"

In Steve Jobs' keynote announcement of the iPhone SDK 4 earlier this year, one of the slides showed that a "Half curl page transition" was part of the new SDK. I've looked through the iOS API docs and I can't seem to find this transition. Does…
indragie
  • 18,002
  • 16
  • 95
  • 164
19
votes
4 answers

Cocoapods installation for YouTube integration

I need to install cocoapods for youtube integration,i used this link http://www.raywenderlich.com/64546/introduction-to-cocoapods-2 for reference This is my podfile ////////////////////////////////////////// # Uncomment this line to…
Ansal Antony
  • 696
  • 1
  • 6
  • 16
19
votes
2 answers

How to get cell text based on indexPath?

I have a UITabBarController with more than 5 UITabBarItems so the moreNavigationController is available. In my UITabBarController Delegate I do the following: - (void)tabBarController:(UITabBarController *)tabBarController…
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
19
votes
5 answers

Are there any standard way to implement the "blue badge" in iPhone?

A lot of iPhone apps use a blue badge to indicate the number of items in the subviews, such as the Mail client: iPhoto http://img.skitch.com/20081103-tjr9yupbhgr3sqfh7u56if4rsn.preview.jpg Are there any standards way (or even an API) do…
leonho
  • 3,563
  • 2
  • 21
  • 16
19
votes
5 answers

How to archive and unarchive custom objects in Swift? Or how to save custom object to NSUserDefaults in Swift?

I have a class class Player { var name = "" func encodeWithCoder(encoder: NSCoder) { encoder.encodeObject(name) } func initWithCoder(decoder: NSCoder) -> Player { self.name = decoder.decodeObjectForKey("name") as…
tadasz
  • 4,366
  • 5
  • 26
  • 33
19
votes
2 answers

UIPageViewController didFinishAnimating not called if swiped quickly

I have a UIPageViewController that works as expected. I can scroll left and right and the delegate method didFinishAnimating is called when I scroll each direction. However, if I scroll too quickly I end up on a page where didFinishAnimating is not…
mattnedrich
  • 7,577
  • 9
  • 39
  • 45
19
votes
2 answers

How do I convert an NSDictionary to a Swift Dictionary?

I am rewriting an Objective-C class in Swift to get a feel for the language. In Objective-C my class included the following method: - (id) initWithCoder:(NSCoder *)aDecoder { return [self initWithActionName:[aDecoder…
bdesham
  • 15,430
  • 13
  • 79
  • 123
19
votes
4 answers

Badge count is persisted after deleting an app and installing it again

My application has a notification section in it, and the sum of the notifications are displayed in the form of Badge Count on the app icon. When the user accesses the notifications the Badge count decreases. Suppose the User now uninstalls the…
user3568907
  • 337
  • 1
  • 3
  • 5
19
votes
4 answers

How to clear a dictionary?

I'm currently doing the following to clear out an NSMutableDictionary [myDictionary release]; myDictionary = [[NSMutableDictionary alloc] init]; The release line doesn't actually release any objects in the dictionary. I can still see all of them on…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
19
votes
3 answers

UICollectionView do not reuse cells

I am having trouble with reuse cells and UICollectionView on iOS 7. My code works fine on iOS 6 but in iOS 7 it does not reuse the cell after calling dequeueReusableCellWithReuseIdentifier (do not call prepareForReuse). Even this code…
19
votes
12 answers

How do I stop a UIScrollView from bouncing horizontally?

I have a UIScrollView that shows vertical data, but where the horizontal component is no wider than the screen of the iPhone. The problem is that the user is still able to drag horizontally, and basically expose blank sections of the UI. I have…
rustyshelf
  • 44,963
  • 37
  • 98
  • 104
19
votes
2 answers

initWithNibName VS NSBundle's loadNibNamed

I've noticed that there are two different ways to load nib/xib files: via the UIView's initWithNibName:bundle: method NSBundle's loadNibNamed:owner:options: method. Can someone explain the differences between these two and when it is more…
tbehunin
  • 1,043
  • 1
  • 12
  • 24
19
votes
2 answers

NSOperationQueue and concurrent vs non-concurrent

I want to setup a serialized task queue using NSOperationQueue but I'm a little confused by the terminology discussed in the documentation. In the context of an NSOperation object, the terms concurrent and non-concurrent do not necessarily …
Alexi Groove
  • 6,646
  • 12
  • 47
  • 54
1 2 3
99
100