xcode

Remove ability for portrait orientation for app in iPhone SDK

Is there a way where I can only allow my app viewable in landscape mode? I've managed to default the application's orientation to landscape, however in the iPad simulator, when I do Command->Arrow, the application rotates to portrait. I've removed the listings in the plist under "Supported interface orientations" for both of the Portrait...

saving NSString and then reading it back

Hey all, this should be a simple task but for some reason i am making it harder... I am trying to save some text from an XML file to a NSString. But when i debug it, the string says "Out of scope". Here is my code: in my .h file: @interface RootViewController : UIViewController<MBProgressHUDDelegate> { NSString *thePW; } a...

Build and install without run in Xcode

Is it possible to build an xcode project for iPhone and have it install the result on a connected device without actually running the application? I'm currently using Build & Run, but I'm debugging a peer to peer game, so I have to build & run for two different devices, stop tasks on each of those and then build & run on the simulator so...

Objective c constantly checking variable values

I need to have a loop that can constantly check for this variable: NSString *charlieSoundVolume; charlieSoundVolume = [charlieSoundLevel stringValue]; This variable will change by an interface builder patch. I was thinking of doing this: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { while(1) { float fl...

Dynamically setting NSString vars in a loop

I am building an iphone game. I have a set of NSStrings that I set periodically throughout the game life cycle. I am finding that I am in need of setting the same NSStrings often and looping through an array of NSStrings is ok for checking the value of the NSStrings atIndex:i, but setting them using the same method results in nothing. Ba...

Texture2D text color changed after updating from iOS 3.0 to 4.0

I'm using an OpenGL Texture2D class and initWithString method to display strings to the user. When running with iOS 3.0 and XCode 3.1.3 all the text would appear black in the simulator and white on the phone. After updating to iOS 4.0, XCode 3.2.3, and iPhone SDK 4.0 the text appears black on the phone! Not so good since my app is alm...

Calling a method in a specific class

Hi I'm currently doing this to add a button to my navigation bar to call the SwitchViews method. UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back to App" style:UIBarButtonItemStyleBordered ...

XCode - trace datatype - typeof?

Hi, i´ve searched the xcode doku but didn´t found anything about logging the datatype of a variable. How can i trace the typeof ? Thanks ...

How to create a dynamic UIImageView

Hi, I want to create an UIImageView with, for example, "Trend.jgp" for a special case (if-condition). I Tried various ways with CGRectMake but i'm not able to create this picture dynamically to a special place. Furthermore, i can't use the function setimage like it's described in the Developer Documentation. Has anyone got an idea how ...

Xcode Build Problem (MinimumOSVersion value is invalid)

When I build app with Xcode 3.2.3 (iPhone SDK 4), following image was showed in Build Log Info.plist: MinimumOSVersion value is invalid. It must be a valid version: (-19024) ...

Replace output console in XCode

Is there a way to replace the output console in xcode or alternatively do highlighting/filtering? ...

NSNotificationCenter: pass Notification between 2 classes

i have 2 classes. class1 gets some information through the net. when one of these informations comes, class1 has to send a notification to class2. i understood it so that i have to put [[NSNotificationCenter defaultCenter] postNotificationName:at"anyUserNotification" object:class2]; into class1 [[NSNotificationCenter defaultCente...

NSTimer - Stopwatch

I've trying to create a stopwatch with HH:MM:SS, code is as follows: -(IBAction)startTimerButton; { myTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(showActivity) userInfo:nil repeats:YES]; } -(IBAction)stopTimerButton; { [myTimer invalidate]; myTimer = nil; } -(void)showActivity; { ...

Which conditional compile to use to switch between Mac and iPhone specific code?

I am working on a project that includes a Mac application and an iPad application that share code. How can I use conditional compile switches to exclude Mac-specific code from the iPhone project and vice-versa? I've noticed that TARGET_OS_IPHONE and TARGET_OS_MAC are both 1, and so they are both always true. Is there another switch I ...

How can i draw custom shape ?

I Want to Draw the custom shape or line for the select the cropping border of the image. Please any one has idea for cropping image help me ? ...

no value entered in TableView row...

I have a basic view with a UITextField and a Tableview. I am able to enter text to the TextView and capture the value through an IBOutlet and IBAction. My IBAction is setMyNote within which I call the cellForRow... method. In my cellForRow.. method I have this snippet code static NSString *CellIdentifier = @"Cell"; UITableViewCell *c...

How to put gradient style table cell in a table?

Hey, I am making a custom table cell right now but my custom cell is just white cell with some buttons and labels in background color which looks not that great. Is there a way to render the background color so that the cell has some vertical gradient effect? For example, on top of the cell it looks white and as it gets closer to center ...

Add external project to my iphone app in xcode

Just starting to poke around iPhone development. I am trying to add an external project/library to mine (specifically the ASIHTTPRequest, http://allseeing-i.com/ASIHTTPRequest/). I am at a bit of a loss as to how I go about actually adding this dependency to my project. I come from a Visual Studio/C# world, and in Visual Studio I kn...

NSTextView Insert Line Break

Hi Folks! I have an NSTextView that I need to insert a line break in. The code looks like this: NSString *myString = @"test" [myTextView insertText:myString]; /**** INSERT LINE BREAK HERE ****/ [[myTextView textStorage] insertAttributedString:MY_ATTRIBUTED_STRING atIndex:myString.length]; Anybody have any idea how to do this? ...

Loading all the values of an attribute of core data to an array

I have an attribute "term" which is a NSString in my core data "Event". When the table view is loaded I want all the values of "name" to be loaded to an array. I used the code - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { Event *event = nil; event = [fetchedResultsController objectA...