iphone

number of lines in UILabel

I need to get the number of lines in a UILabel, so that I can move another UILabel to be at the bottom of the last line of text. I have done: int lines = [cellDetailTextLabel.text sizeWithFont:cellDetailTextLabel.font constrainedToSize:cellDetailTextLabel.frame.size lineBreakMode:UILineBreakModeWordWrap].height /16; but well it's not ...

iPhone rotates screen after changing view

Hello, i have an app with two views. both are in landscape view. if i change the views, the screen of my iphone rotates from portrait mode into landscape mode. but it was in landscape mode before i changed the view. this happens every time i change any view. i simply want two views that are ALWAYS in landscape mode even if they came vi...

How to wrap a C++ lib in objective-C ?

I have a C++ library (.h only) that contains the implementation of a data structure and I'd like to use it in my iPhone app. Firstly, I wrote a wrapper in objective-C++ as a class that, through composition, has an ivar of the C++ class. I then was 'obliged' to change the wrapper class extension to .mm, and it seemed fine. But then I ha...

How to make a CATransform3dMakeRotation rotate the other way? And chain together...

I'm working with some Core Animation for the first time and in the process of implementing a playing card that I can flip around, I've decided to use a CALayer to display the contents (not sure how I'm going to get two sides, but that's another question) and I need to be able to flip it over, move it, etc... I'm using CATransaction with...

iPhone UIActivityIndicator threaded help!

I'm looking to create a generic thread in my main delegate that I can use to display a UIActivityIndicator. I have several views that push new views onto the stack. Most of the views are called from the didSelectRow method in the calling view. When they select a row in a UITableView, I want to start the Activity Indicator and push the ne...

Can a UIActivityIndicator be displayed over a MPMoviePlayerController in full screen mode?

In an iphone app, I create an MPMoviePlayerController and instruct it to start playing video in full screen mode (I don't think there is any option for anything but F/S mode on iPhone like you can on ipad). Once the full screen player comes up, the entire screen is black and there are no controls visible (set to MPMovieControlStyleDefau...

Is CGContextGetTextDrawingMode() a private API?

I'm using this sniplet to center strings that are drawn with CoreGraphics. I can't find any documentation on the function CGContextGetTextDrawingMode(). It's obvious what it does, but is this a private API that I should avoid? ...

Rotate a UI Button in iPhone SDK

Quick and hopefully obvious question. I have a progmatically created button in my iPhone app that I wish to rotate 45 degrees clockwise, named buttonuq , how can I do this? ...

split string from string

I have a string that contains <name>James Jones</endofname> how would i get the name from the centre pragmatically. Thanks James ...

Swapping objects. Cant get my head around it.

Ok if I have 3 objects. ObjectType *objX; ObjectType *objY; ObjectType *tempObjHolder; objX = [[alloc ObjectType] init]; objY = [[alloc ObjectType] init]; // some code to change values in the objX and objY tempObjHolder = objX; objX = objY; objY = tempObjHolder; Am i swapping the objects ok. Or am I confused to how this works. Do i...

Pass data to view controller from subview iPhone

Hi, Probably a simple question but I haven't found a solution. I have several view controllers with some sliders that when dragged, input numbers into a label. I also want to have a simple popup keypad enter numbers into this same label. I created a view controller called Keypad and when a button is tapped on the current view controll...

memory leak in uimapkit polyline

Hi, I'm practicing drawing polyline on the Map. I've adopted Sample code from download here. Here is the part that I got memory warning when I do build->Analysis MKMapRect routeRect = MKMapRectMake(southWestPoint.x, southWestPoint.y, northEastPoint.x - southWestPoint.x, northEastPoint.y - southWestPoint.y); // clear the memory allocat...

iOS communicating with OS X

I'm looking for a pointer in the right direction to get started with writing an iPhone app that sends commands to OS X, for example telling OS X to sleep. I can't seem to find the relevant part of the documentation? ...

NSFetchedResultsController

Hi, I am working with a UITableView that gets its data from an NSFetchedResultsController. I would like to add a UISegmentedController to my navigation bar that would toggle the table between displaying all of the records and only the records where starred == YES. I have read some other SO posts indicating that one way to do this is t...

iPhone - testing if a notification exists

At some point in a code one may add something like [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomething) name:@"Hello" object:nil]; How do I test if this notification is already active on the queue or has been removed, to prevent adding a duplicate? thanks. ...

Present another modal view from UIImagePickerController

I want to add a confirmation view after the user takes a photo or selects a saved photo. The confirmation view will just show the selected image, with a cancel and upload button in a toolbar. My UIImagePickerController is presented modally from one of my view controllers, which is controlled by a navigation controller, which is in turn ...

iPhone: How do I add a 'next 25' like at the bottom of the screen in the app store app?

I've got a UITableView and I want to have a 'next 25' feature like in the app store app. However, I've no idea what control they use and how to develop it. Can someone shed light on it and give me as much info a possible ? ...

How to clear back forward list in UIWebview on iPhone?

Hi all, I want to access/clear the back forward list as if the UIWebView is new again. Is there any public api or workaround to do this? I've tried while ([webview canGoback]) { [webview goBack]; } but that will freeze the device (simulator too) Thanks! ...

iPhone: how do I add the discolsure and delete icons to a UITableView ?

I need to have a disclosure and delete icon on my UITableView how do I add them ? I think the delete doesn't show all the time ? although I'm not sure about this, can someone advise? ...

Sending cell-values in cellForRowAtIndexPath at button-press.

Hey! I have stumbled upon a problem when adding a button to my table view cell. Let me explain after i have added the code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; RadioCustomCell * cell = (RadioCustomCell*)[tableView dequeueRe...