cocoa-touch

How do I find the size of my Core Data persistent store and the free space on the file system?

I am working on a database application using the Core Data framework. In this application I need to display how much data the application currently is using on the iPhone. Is there any way to do this? ...

a table view from modal view

I am designing application which is completely based on modal view controllers. now, after i navigate 4 to 5 screens of my application i want to show the data in tabular format. All sample applications show table view as the first screen . Please tell me how am i to show the table view later on My case is: I give the start date and end...

multiple touch problem in Cocoa touch/i-phone

I am going to develop a ball game where i have to touch two/more ball simultaneously.So how will i detect these multiple touch. I came to know the following way i can detect multiple touch- -(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event { UITouch* touch = [touches anyObject]; NSSet *touch2 = [event allTo...

Why does code that uses NSHost compile correctly using the iPhone SDK?

I have some code that was written for Mac OS X and it makes a lot of use of the NSHost class. During my efforts to bring this code to the iPhone, I discovered that NSHost isn't available in the iPhone SDK, and should instead be replaced with NSStream and the related networking classes. Anywho, I've been working on it to port it over to ...

Smoothing out didAccelerate messages

I'm working on something similar to an inclinometer. I rotate an image based on the angle calculated in didAccelerate (from UIAccelerometerDelegate) using the passed in UIAcceleration variable. The image is jittery or twitchy. Even when the phone is laying on its back and not moving. There are some inclinometers in the app store tha...

What are the conventions for declaring a UITabBarController in mainwindow.xib?

I have a mainwindow.xib file with a UITabBarController as the base view controller of the app. So inside the UITabBarController I've added about 10 sub UIViewController objects as tabs. Most of them are just a UITableViewController subclass or a UINavigationController containing a UITableViewController subclass. In this design, each U...

NSUserDefaults are not being written to disk

Hello, I set some values to NSUserDefaults and if I retrieve them without exiting the app, everything works fine. When I restart the app, the changes disappear in 95% of the time. In 5% of the time everything is being saved ok. I'm facing this problem for the first time. In my other apps I don't usually save NSString in NSUserDefaults....

"Unknown class <MyClass> 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 library, and does not happen if I compile the class directly in the application target. ...

Choose Music from iPhone app? - iPhone SDK

Hey guys, Can anyone give me a head starters on this question. How would I be able to make an app that searches through your music contents that are already synced on your phone and play them. I don't want to do a scroll view, where the user just presses on the options. Instead I want the user to type the song name and if the song is f...

Design view in Interface Builder to load lazily in UIViewController

I've managed to get my myself confused... I've got a fairly complex View Controller much of which is developed programatically. I'd like to pop up a "dialog" on top of the view controller at some point and I'd like to "design" that view in Interface Builder because it's fairly straightforward (background UIImageView, some UILabels and a ...

iPhone: UITableView scrolling under Tab Bar

I've got a UITableView and I can't figure out how to get the size right. My app is based on the Tab Navigator template. One tab's view loads a NIB that contains a Navigation Controller. The root view controller of the Navigation Controller has it's class set to a UITableViewController that doesn't have a corresponding NIB. The UITableVi...

Animating Frame of UILabel smoothly

Hello all, I've been trying to figure out a decent way to smoothly animate a frame size change on a UILabel, without a weird starting jump redraw. What happens by default is that when I do something like this: // Assume myLabel frame starts as (0, 0, 100, 200) [UIView beginAnimations:@"myAnim" context:NULL]; [UIView setAnimationBegi...

Circular #import/@class problem in ObjectiveC

I'm going to use an example to properly illustrate my confusion. I can't quite wrap my head around this. In Cocoa touch, we have UIViewController and its subclass, UINavigationController. Now, UIVC has an ivar of type UINav, and to get around the circular import problem they use @class UINavigationController. I am assuming they then #im...

Alpha + masking + clipping headache

Hi, Here's a graphical explanation of 1) what I have and 2) what I want http://tinyurl.com/yg5zboy My understanding is I need one or maybe two masks to accomplish this. As you can see, I want to combine both alpha channel (for the red semi circle) and a background transparency (to see the background shuttle, even through the hole in t...

iPhone settings bundle

I want to allow the user to enter a valid date using the iPhone’s settings application. I have experimented with many of the PreferenceSpecifiers data node types including date. I have two issues: When I specify date as the type, my app within the settings app crashes. Working examples would be greatly appreciated. Since this approac...

Why isn't my UIButton responding to touches?

I'm sure I'm overlooking the obvious as I've got countless working buttons...but...for whatever reason this one is not cooperating... I've added a UIButton (Rounded Rect) to a UIView subclass (DialogView) which is a subview of my view controller's view. This subview is created almost entirely in IB. I've wired up the button to (IBAction...

Telling a UITextField to become first responder while embedded in a UITableViewCell

I have a UITextField that is a subview of a UITableViewCell. When my view loads, I want the text field to become first responder. I have a pointer to the text field in the table cell, so to do this I am trying: [myTextField becomeFirstResponder]; This returns NO all the time, regardless of when it's called, which according to the doc...

How do you create UIBarButtonItems with a radio interface?

I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up radio UIBarButtonItems in the class reference definition of the width property: If this property value is positive, the width of the co...

How should I do to pop all or Specific Number viewsController?

[self.navigationController popViewControllerAnimated:YES]; This code is to pop only one viewController. How should I do to pop all or Specific Number viewsController? ...

What are common Cocoa pitfalls?

Triggered by Mike Ash’s newest article “Dangerous Cocoa Calls” from his great Friday Q&A series, I want to know which are the things in Cocoa that made your code stumble. Mike has compiled a great list of evil API uses that are mostly about thread and exception safety. I’m sure that there are more hidden pitfalls that Cocoa programmers s...