xcode

Why is my UIWebView not scrollable?

In my most frustrating roadblock to date, I've come across a UIWebView that will NOT scroll! I call it via this IBAction: -(IBAction)session2ButtonPressed:(id)sender { Session2ViewController *session2View = [[Session2ViewController alloc]initWithNibName:@"Session2ViewController" bundle:nil]; self.addictionViewController = ses...

Manage build target variables in iphone project

We're transitioning to an automated build process for our iphone projects. These projects can be checked out by individual devs, in which case all the API URLs need to point to a certain path. There are also a variety of build environments, each with their own API root paths. I could probably add multiple, different build targets, and...

How Do I Test for Existence of an External Constant NSString?

In iPhone SDK 3.2, the MediaPlayer framework was expanded. One of the constants newly defined in the framework is MPMediaPlaybackIsPreparedToPlayDidChangeNotification. I'm building a universal app. How can I test at run time for the existence of this constant? If the constant exists, then my app can use this newer notification. If not,...

Conditional interface programming for iPad?

Hi everyone! I'm working on an app for the iPad and am a little over my head with one issue. Is it possible to build an app for iPad that uses a function to control which interface layout is displayed? Something like "if these parameters are met, use XIB file "a" else use XIB file "b". I know that's not in any kind of legitimate format, ...

NSUserDefaults doesn't save

Hi everybody! i'm trying to save some informations in an iphone/ipad app. The problem is that it works but if i close the app (with the home button on the simulator or closing with cmd+q) the informations become lost! this is my code (and, if you see, i used "syncronize") - (IBAction)choose1{ NSUserDefaults *defaults = [NSUserDefa...

Creating a window from a menu item

I would like three menu items on the menubar with the keyboard shortcuts cmd-1, cmd-2, cmd-3. This I know how to do. Each menu item would open up a different window (win1, win2, win3). I want it so that only one instance of each window is permitted to be open at any one time (i.e. only one win1, one win2, etc). How is this best approa...

iPhone OS: Why is my managedModelObject not complying with Key Value Coding?

Ok so I'm trying to build this stat tracker for my app and I have built a data model object called statTracker that keeps track of all the stuff I want it to. I can set and retrieve values using the selectors, but if I try and use KVC (ie setValue: forKey: ) everything goes bad and says my StatTracker class is not KVC compliant: valueF...

How do I handle memory warnings when generating UIImages from PDF files in Objective-C?

When converting PDF Pages into UIImages I receive memory warnings all the time. It seems there is either some leak or something else that eats my memory. Using instruments didn't give me any helpful details. I'm using the following function to generate images from a pdf file: - (UIImage*)pdfImage:(NSString*)pdfFilename page:(int)page...

commitAnimations is not resizing my UIImageView subview

I have created a UIView as a subview and to that subview I have added a UIImageView as a subview. UIView *viewCreated; UIButton *buttonCreated; UIImageView *imageViewCreated; CGRect myFrame = CGRectMake(0, 0, 1024, 1024); viewCreated = [[UIView alloc] initWithFrame:myFrame]; [viewCreated setTag:intTag]; viewCreated.backgroundColor = [UI...

What are advantages of adding views programmatically vs using InterfaceBuilder?

I've heard its simply a question of preference. But there must be advantages to adding views programmatically. Any experienced Xcoders care to comment? ...

How to pause the application when quit the home button in iphone

Hellow All, I am developing one game application for iphone.Here whenever user get the call or SMS or he quit the appication ,my application should be in pause state .so,whenever he loads the application again,it should go to previous state where it stopped. Are there any built-in methods for doing this Thanks all ...

How can keep track of the index path of a button in a tableview cell?

I have a table view where each cell has a button accessory view. The table is managed by a fatchedresults controller and is frequently reordered. I want to be able to press a button and be able to obtain the index path of the pressed button's tableviewcell. I've been trying to get this working for days by storing the row of the button in...

set Width & Height alone on Views in iPhone Development

Hey guys, I am working on an iPhone project where i need to change the width and height of a UIImageView dynamically. I have come across CGPointMake to change x & y positions alone, but what should i use for changing width & height alone??. There's something called CGSizeMake but i am not able to make it work. Can someone help...any idea...

How to tell XCode to run IPhone or IPad Simulator ?

Hi I want to prepare my App for the IPad, but what ever I do I can not get this to work. Without any changes to the project, the Active Executable says "xxx - IPhone Simulator". So what do I have to do to make my app run in the Ipad Simulator ?! Thx ...

Certificate in iPhone App

Hi, I'm working with iphone application and i want put it in my iphone. In xcode there is a overview "device - 3.1.3 | debug" but when i "build and go" the project there is an certificate error. I have download a certificate "mobileprovision" with a correct "Identifier" but i don't know how put it in my xcode project. Thanks and sorry f...

How do I get the index of the current Object in an NSEnumerator iteration?

Question: How do I get the index of the current Object in an NSEnumerator iteration? (I don't want to keep track of things using an integer counter or use a for loop due to speed reasons. I did it before I just cannot remember how I did it...) ...

Error of iPhone certificate

Hi, I have a big problem. I have downloed a certificate from apple site. When I put it into xCode have a warning : "A valid signing identity matching this profile could not be found in your keychain" and can't build the app. Thanks and sorry for my English XP ...

Is there a way to set a default "role" for headers in Xcode? (I want all my headers public by default.)

I saw this question about changing them all at once, which was helpful. But I was wondering if there is a way to set a (hopefully per-project or per target) default role (public/private/project) for header files? I have a static library project and a main project that depends on it. I often forget to set the header role to public when I...

push viewcontroller using UINavigationController sometimes calls viewDidAppear: and viewWillAppear:

When pushing a viewcontroller using UINavigationController into the view: What is necessary for it to trigger viewDidAppear: and viewWillAppear: ? What makes it fail to not trigger viewDidAppear: and viewWillAppear: ? We are having a hard time relying on wether those methods gets triggered or not. ...

OCUnit testing an embedded framework

UPDATE: I ended up giving up and added GHUnit to my project instead. I got up and running with GHUnit in a matter of minutes. UPDATE: You can download the Xcode project here: http://github.com/d11wtq/Cioccolata I've added a Unit Test target to my Xcode project but it fails to find my framework when it builds, saying: Test.octest could...