To open Google Maps with directions, i'm using a formatted NSString inside a NSURL. But it doesn't work with [[UIApplication sharedApplication] openURL:nsurl];
code:
NSString * directionsURL = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=%@&saddr=%@", @"Hartenseweg 16, Renkum", @"1 Infinte Loop, Cupertino"];
[...
I have a class that relies on NSUserDefaults that I'm trying to unit-test and I'm providing the NSUserDefaults as a mock into my test class. When running the test, I get the error:
OCMockObject[NSUserDefaults]:
unexpected method invoked:
dictionaryForKey:@"response"
I'm trying to mock this instance method of the NSUserDefaults ...
Hi All
I have a picker with three components.
The first two components are dependent on the last.
So it could be:
| 5 | M (The lines represent the different columns)
or
1" | 5" | FT
If I am moving the second or first column and before they stop spinning I move the third column from from FT to M or visa versa and then while ...
I have to fit strings within a table. The strings are of different lengths. The cell of the table should be sized according to string length.
I am using sizeWithFont:constrainedToSize: .
But I could not use it properly. Can any one please suggest a solution?
...
I have a UIView whose layers will have sublayers. I'd like to assign delegates for each of those sublayers, so the delegate method can tell the layer what to draw. My question is:
What should I provide as CALayer's delegate? The documentation says not to use the UIView the layers reside in, as this is reserved for the main CALayer of...
I try to set two different views into a subview, according to the state of a SegmentSwitcher:
if ([sender selectedSegmentIndex] == gameIndex) {
if (self.gameView.view == nil) {
GameView *gameV = [[UIViewController alloc] initWithNibName:@"GameView" bundle:nil];
self.gameView = gameV;
[gameV release];
}
...
I am referring to the popup window that asks the user to submit a review/rating.
I know it can be done since the Aardark app does it...it asks several times in fact! (Almost too spammy.) But there has to be an API to trigger the rating request? Google is giving me no love on this one.
...
We're storing text in SQLite and displaying it in UITableViewCell within our iPhone application. UITableViewCell seems to recognize line breaks from SQLite, but not bold text. Any suggestions would be much appreciated.
...
Hi,
I am new to Core Data, and have been trying to figure out how to set up my data model. I made a sample table to try and show how I need the data to relate.
First Name Last Name Competitor Number Gender Team Competition Game Name All Time high Competition Scores
Jon Doe 1 M Gamers January Don...
I'm trying to use NSAssert throughout my iPhone app so that if an unexpected condition occurs, the application fails-fast and crashes with a meaningful message in the crash log.
This works fine if the failing NSAssert is on the main thread, as it raises NSInternalInconsistencyException by default which is uncaught and stops execution. B...
Hello!
I am using this example of Apple's sample code:
http://developer.apple.com/iPhone/library/samplecode/TableSearch/index.html
In this example the UITableView get a list of content at startup. Clicking in the UISearchBar and typing, the content list will be filtered, also checking on scope of the ScopeBar.
I have to rebuild this ...
I am programing a shooter game in cocos2d for the iphone. I and I want to exclude collision detection an the alpha of my sprite.
How do I read the RGBA value of the single pixel.
Thanks for the help.
...
When you have more than 5 view controller in your TabBarController, a "More" view is automatically setup for you. Is it possible to change color of the navigationBar in this view to match the color I am using, instead of the default blue?
...
On my iPhone 3G I have a couple videos saved from emails and some apps i recored with and every time I try and open the UIImagePickerController it doesn't show the videos for me to choose. How do I get the UIImagePickerController to include videos and not just pictures?
...
When creating a custom UITableViewCell I notice that it looks as expected in 'plain' style but that the corners of the cells are not rounded if the table view is displayed in 'grouped' style: i.e. the corners are square.
I have searched but cannot find any real explanation of why this happens and, more importantly, how to remedy this ef...
I have UIView subclass - actually a puzzle piece - with 2 different CGLayer initialized at initWithFrame.
In drawRect I have to blend this two layer, and the uppermost should have variable alpha depending on game-logic.
What is the best (most performance optimized) way to do this? Is there any CGLayer, or CGContext function that sets s...
Hi there,
Well, the title says it all. I'd like to have a UIViewController which has an Add and a Trash button both right to the title, either by adding two UIBarButtonItems to the navigation item/bar or by adding them to a UISegmentedControl and then adding the SegmentedControl to the item. Is this possible? If yes, how is it achieved ...
I have an iPhone app that uses an action sheet but I can't work out how to make one of the buttons open a new view when pressed. I know how to implement the action sheet - that's not a problem, its the actual action of opening the new view that's the issue.
Any help would be greatly appreciated. Thanks.
...
hi guys . i had questioned here : http://stackoverflow.com/questions/1675113/best-idea-for-importing-text-to-each-navigationcontroller-view
the answer was this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
PoemDetailsViewController *poemDetails = [[[PoemDetailsViewController alloc...
Let's say I'm building a new class for the iPhone in Objective-C. In one of my init methods I want to manually allocate some memory. So, I might have something like this:
- (id)initWithSomeObject:(SomeObject *)someObject {
self = [super init];
if (self != nil) {
myObject = someObject;
[myObject retain];
if ( (memory = ...