iphone

How to get the name of a class of a method as NSString?

I need the name of the class that owns a method, as NSString. Example: There's a -fooBar method inside a SomeClass, and that -fooBar method runs some code. This code must print out what class "owns" it, I mean: What class that method belongs to. So I can't hard-type the class name in a NSString because I need that for debugging purposes,...

SubViewTwoController not declared (obj-c)

Hi everyone, I am trying to find my way into Obj-C for iPhone programming using this tutorial. In the end, what ever menu point you choose, SubViewOne was displayed. I want to change this and in the end SubViewTwo(.xib) should appear when tapping the menu point "Sub View Two" So what i did was changing the second repeat of SubViewOn...

How to create a macro with multiple lines of code?

I want to make a macro which will inject some code, like: if (foo) { [Bar fooBar]; } and then, where ever I need that, I put FOOBAR in the code. Not sure, but at compile time then the compiler replaces this with the actual code like in the example above. Maybe there's something different than a macro I could use for this? ...

UIViewController Overlaping Views

I know that I'm either operating with a fundamental misunderstanding or have just missed something simple here. Basically I'm trying to add a new UIViewController on top of an existing UIViewController when the user clicks a UIButton. -(void)newCharacterClick:(id)sender{ characterViewController *viewController = [[[characterViewCont...

Easy question: What does it mean if a variable is highlighted in red in the XCode debugger?

I'm having some trouble squashing some bugs in my iPhone application and I have come to the realisation that I'm not entirely clear on what the significance of a variable being highlighted in red? Does it mean the variable no longer exists? ...

Smooth UIAccelerometer

How can I smooth the accelerometer of the iPhone/iPod Touch? ...

Apple's core location prompt - why does it jump back to Root View controller?

I have an iPhone app using a UINavigationController. On the fourth controller of the stack, I'm doing some Core Location stuff - so, the first couples of times that the user uses my app, they are asked if it's ok to use Location Services. This is a process that (I think) I don't have any control over. After the user confirms, they are ...

Text localization in iPhone apps that use openGL ?

I'm writting an small game in iPhone, and I'm being asked to add in-game text will be localized in EFIGS+J+Chinese Simplified and provided to me later. Which tools and methods are avaiable in OpenGL ES for the iphone in order to render text ? ...

Using iPhone OS 3.0 features if available, and 2.1 features if not, in one executable

Hey guys, I've seen apps on the iPhone that if running on 3.0 will use 3.0 features/APIs such as the in-app email composer, and if running on 2.x not using those features, and exiting the app to launch Mail instead. How is this done? My initial thoughts were to use #ifdef __IPHONE_3_0 but that will only work if I actually build the...

What are assertions or NSAssert good for in practise?

I wonder if it's a good habit to use NSAssert all over the place? What would be the benefit of doing that? In which situations is it a good idea to use it? ...

MPMoviePlayerController in Portrait mode ?

Hello, I would like to know if it's possible to have a MoviePlayer in portrait mode. Thanks for your help. T. ...

Alpha transparent PNGs not displaying correctly in Mobile Safari

I'm using some semi-transparent PNGs as background-images on various websites. These are usually something like a 1x1 image with a 30-percent opaque white layer. I've noticed that Mobile Safari does not display them correctly, giving them a darker/grayish tint. I've created a couple test pages to illustrate. View them both in your norm...

Most efficient way to draw individual pixels in OpenGL ES (Cocos2d-iphone)

I'm writing a flood-fill algorithm...it needs to paint individual pixels. What's the fastest way to do this? At first I thought of using cocos2d's drawpoint, but having 320 * 480 vertices doesn't sound too good. Is there a faster way using memset or something? ...

iphone Dev: Invalid Context CGContextDrawLayerInRect

I have a uiscrollview within three subUIViews 1, 2, 3. I load content for subUIView1, 2,3 dynamically. Here are steps I create scrollview with these 3 subUIview and with a default size for each subUIView I create an operation for each subUIView, let us say Operation 1,2,3. add to operation queue every Operation (operation 1) calcula...

Persistence scheme & state data for low memory situations (iphone)

What happens to state information held by a class's variable after coming back from a low memory situation? I know that views will get unloaded and then reloaded later but what about some ancillary classes & data held in them that's used by the controller that launched the view? Sample scenario in question: @interface MyCustomControll...

asp.net controls for iPhone development

The ASP.NET iPhone controls from ComponentOne is an interesting idea. However $800 is beyond my budget. Is there anything similar in the open source/free/cheaper world? ...

How to get rid of all this garbage in NSLog?

When I use NSLog(@"fooBar") it prints out a lot of stuff I don't want: 2009-09-03 13:46:34.531 MyApp[3703:20b] fooBar Is there a way to print something to the console without this big prefix? I want to draw a table and some other things in the console so that space is crucial... ...

How to customize tableView seperator in iPhone

By default there is a single line separator in uitableview. But I want to put my customized line as a separator. Is it possible ? How ? Thanks in advance for helping me. ...

Landscape orientation for UITabBarController?

The UITabBarController does not allow landscape orientation. So I used a subclass of UITabBarContoller (called RotatingTabBarController). Its sole purpose it to allow rotation by returning YES to shouldAutorotateToInterfaceOrientation call. The problem is that when you rotate the iPhone in simulator it gives the following malloc error. ...

Is there a way to setTitle on a UIButton that updates all UIControlStates at once?

I have a UIButton, and I'd like to update it's title. But I'd rather not have to always do it each and ever state like the following: [myButton setTitle:@"Play" forState:UIControlStateNormal]; [myButton setTitle:@"Play" forState:UIControlStateHighlighted]; [myButton setTitle:@"Play" forState:UIControlStateSelected]; Is there a better...