xcode

XCode instruments not reporting any data

I'm trying to debug in XCode using the instruments but most of them are not showing any data. I tried this from my home machine and it worked fine, but on my work iMac the following instruments report no data at all: Activity Monitor Allocations Memory Monitor The Leaks instrument seems to be working fine. I am developing an iPad a...

Cocos2d Accelerometer Movement

Hello, I was wondering how you would move a CCSprite right and left by tilting the device right and left. Like in the falling balls app. Thanks in advance, John ...

Xcode app version not compatible with Mac OS X version

am using Os X 10.6.4 and X code Version 3.2.3 for developing some simple app files and using PackageMaker to distribute these app files. But when trying to run the package on some other mac I am getting error that the package is not compatible with the Os X its running and file would not be installed. Is this a problem with X code or pac...

How to switch to another view

The following code should work, right? ViewController2 *childView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil]; [self.navigationController pushViewController:childView animated:YES]; [childView release]; It doesn't do anything though. There are no error messages. The view just doesn't get switched. viewD...

How to check a variable's value using a debugger in XCode

How do you use the debugger in XCode to see if a variable is nil? ...

How do I change the color of TableView and Button controls in iOS?

I designed a web app for iPhone and am now trying my hands at a native Objective-C version, and I'd like to retain some continuity with my original design. Since my web version uses CSS, I was able to customize the color palette, even though the UI was designed to imitate a native iPhone UI. I'd like to use a similar color scheme for my...

How to check if self.navigationController is nil

In the following code, I am able to check with the debugger the values of self and childView. [self.navigationController pushViewController:childView animated:YES]; However, I am not able to see the value of self.navigationController. How can I check if it is nil? ...

Why does self.navigationController become nil?

I have this code: ViewController2 *childView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil]; [self.navigationController pushViewController:childView animated:YES]; I the first line, self.navigationController has a value. On the second line, its value becomes 0. Why is that? ...

presentModalViewController vs. pushViewController

I can show a different view with this code: [self presentModalViewController:childView animated:nil]; This code should do the same thing, right? [self.navigationController pushViewController:childView animated:YES]; But it doesn't do anything. Why is that? ...

pushViewController and Navigation Applications?

Why do Navigation Applications use pushViewController instead of presentModalViewController like all the other apps? How can a Navigation Application be modified to use presentModalViewController instead? Would it be sub-optimal to do so? Why? ...

How does a Navigation-based application get access to the UINavigationController class?

In a Navigation-based application, the method pushViewController:animated can be used. This is a method of the UINavigationController class. However, nowhere in the source files do I see any #import statements that import this class. The documentation doesn't show UIViewController as inheriting from UINavigationController. So how are Na...

Xcode folder as bundle/package

Hey guys, I have made a file format which is just a folder with an extension. I have set up an app the makes finder use it as a package but when I drag it into the resources in xcode it expands that package into a folder. Is there a way I can get xcode to treat a folder like one file regardless of what is in it? The reason I need this i...

"Program exited with status value:5"

I've looked around a good bit and never found a comprehensive list of exit codes for Xcode especially working with iOS. This question: http://stackoverflow.com/questions/2504512/debuging-to-simulator-crashes-with-exited-with-status-5-unless-i-have-breakpoin simply says I need to restart xcode. But the problem is still there for me. So...

Is UITableViewController compatible with NSCoding?

When I try to get a h file that inherits from UITableViewController to conform to NSCoding, I can't switch views. - (id) initWithCoder:(NSCoder*) coder { [self init]; return self; } Inserting the above code into the m file is what causes the problem. Why is that? ...

How to restore an array with NSCoder

So far I have the following: - (id)initWithCoder:(NSCoder*) coder { self = [super initWithCoder: coder]; if (self) { // Call a setup method } return self; } Am I supposed to put the code to load the array in here? What could should I put and where should I put it? ...

creating a block device programmatically in mac os x using iokit framework

Hey all, As i am a total noob to mac os x programming i am having some problems understanding this.I want to create a block device in mac os x leopard which would act as a normal drive in mac os x and after that i want to define the geometry of that device or drive according to a drive which i created during installation. As i a...

Change music file Balance

Is there any way to change a music file Balance? for example I want to play a sound only from left speaker(by default my sound file is playing in both speaker) ...

When does encodeWithCoder get called?

This will save an array (I think). - (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeObject:myArray forKey:@"myArray"]; } Do I have to directly call this method when I want to save an array or do I have to do something else? ...

When does initWithCoder get called?

This will load an array - (id)initWithCoder:(NSCoder*) coder { self = [super initWithCoder: coder]; if (self) { myArray=[coder decodeObjectForKey:@"myArray"]; } return self; } What is the code that will call this function so that the array can be loaded? ...

Testing a iPhone app in iOS 3.0

I have a program that ran in iOS 2.0 and now am making some updates to it. I don't think I have done anything that won't be available in 3.0, but I don't have a 3.0 device around to test it on. I do know that I updated one deprecated function addTimeInterval to the new version dateByAddingTimeInterval a few questions - 1) Is there ...