iphone-sdk-3.0

NSString to NSurl

余生颓废 提交于 2019-11-30 00:09:52
having trouble getting NSSTRING to convert to NSURL, item.image, holds the url for an image that im getting through xml NSString *urlString = [NSString stringWithFormat:@"%@", item.image]; NSURL *url = [NSURL URLWithString:urlString]; NSLog(@"string> %@ ", urlString); NSLog(@"url> %@ ", url); 2011-06-23 11:18:49.610 Test[10126:207] string> http://www.harlemfur.com/images/Dog_Olive.jpg 2011-06-23 11:18:49.611 Test[10126:207] url> (null) also if i try : NSString *urlString = [NSString stringWithFormat:@"%@", item.image]; NSURL *url = [NSURL fileURLWithPath :urlString]; 2011-06-23 11:22:08.063

How to use LinkedIn API in iPhone SDK?

家住魔仙堡 提交于 2019-11-29 21:43:35
I want to use the LinkedIn API in my project, but I haven't found any good tutorials about using LinkedIn API. How to use LinkedIn API? "A beginners guide/introduction" of "basic concepts" would be helpful. OK, after googleing around I went to this link LinkedInAPI . I filled in the form but I am unable to understand what the "Integration URL" (Example URL where the integration will go live.) Because I want to use LinkedIn in native iPhone application not on any website? So after getting keys how do I use those keys and how do I authenticate user and get some profile info,post status like all

Check whether zoom level changed

白昼怎懂夜的黑 提交于 2019-11-29 21:08:00
I'm using MapKit on iPhone. How can I know when the user changes the zoom level (zoom in\out the map)? I've tried to use mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated; but that's called even when the map is only dragged. Unfortunately, when the map is dragged the mapView.region.span changes as well... Help? 10x afarnham It is pretty simple to calculate the zoom level. See the snippet below. You can get the mRect parameter from the visibleMapRect property on your MKMapView instance. + (NSUInteger)zoomLevelForMapRect:(MKMapRect)mRect withMapViewSizeInPixels:(CGSize

I cannot get in app purchase test to work

放肆的年华 提交于 2019-11-29 21:06:47
问题 I have had zero success with in app purchase. I have submitted the free app binary, and then rejected the binary. I have added the test product. I have approved the test product TAP001. I have followed the code examples to no avail. I do a SKProducts request using both "com.companyname.appid.TAP001" and just "TAP001" Regardless, I get an empty response.products and response.invalidProductIdentifiers with the product string I sent. I created a test user, but seeing how I cannot get any product

ABAddressBookCopyArrayOfAllPeople and ABAddressBookGetPersonCount return different sizes

血红的双手。 提交于 2019-11-29 20:40:44
问题 I have an app which crashes occasionally due to the array returned by ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering() having a different size to ABAddressBookGetPersonCount(). The shell of the code is shown below. Usually nPeople is the same size as the array. However, on one user's iPhone (or at least, as reported by one user), nPeople is almost twice as large. I can stop the crash by using the array size, rather than ABAddressBookGetPersonCount(). However, I am not sure if this

How to add hours to an NSDate?

让人想犯罪 __ 提交于 2019-11-29 20:14:48
I have a date converted to double value and saved in database. Now, I want to compare if currentDate > myDataBaseDate + 8 hours i.e., I want to get 8 hours added to myDataBaseDate. I'm converting date into double values. So how do I get 8 hours later time from my database saved date. How do I compare if (currentDateTime > DateFromdatabaseValue + DateByAdding8HoursInDataBase) Tom Jefferys I'm not entirely sure what you are trying to do, but you can create an NSDate object by adding time in seconds on to another NSDate using: - (id)dateByAddingTimeInterval:(NSTimeInterval)seconds // eg. to add 8

Adding image to navigation bar

…衆ロ難τιáo~ 提交于 2019-11-29 19:45:00
I'd like an image to take up all of a navigation bar. This is the navigation that comes with a navigation based app. It appears on the RootViewController with the accompanying UITableView. I've seen some examples of how this might work. Set navigation bar title: UIImage *image = [UIImage imageNamed:@"TableviewCellLightBlue.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; [self.navigationController.navigationBar.topItem setTitleView:imageView]; The problem there is it only covers the title rather than the entire navigation bar. There is also this thread: http:/

Does Facebook class of iPhone Facebook SDK have cancel method?

我与影子孤独终老i 提交于 2019-11-29 19:11:56
问题 Is there anyway to cancel a Facebook object's pending request? I can't find any methods in Facebook.h, or a way to access the underlying NSURLConnection object. If I press back on the navigation bar and the their is a pending asynchronous Facebook request, the request tries to send a message to a deallocated view once the response has come, causing the application to crash. 回答1: For anyone who comes across this question, it appears that Matt's observation does not apply to the newest facebook

Am I misunderstanding reloadRowsAtIndexPaths:

孤街浪徒 提交于 2019-11-29 19:04:50
问题 I have a grouped table view where I want to reload a particular row. When I call reloadRowsAtIndexPaths: the row disappears completely from the table view. Is there something else I need to be doing? //this is the method doing the reload -(void)setDurationTableViewCell:(NSString *)dur { self.workoutDuration = dur; NSIndexPath *durPath = [NSIndexPath indexPathForRow:3 inSection:0]; NSArray *paths = [NSArray arrayWithObject:durPath]; [woTableView reloadRowsAtIndexPaths:paths withRowAnimation

How to add a vertical swipe gesture to iPhone app for all screens?

半城伤御伤魂 提交于 2019-11-29 18:51:45
问题 I'd like to add a gesture to my app so when the user swipes vertically it triggers a method to do something. The swipe can be up or down. I've never done anything with gestures so this is my first use of a gesture other than what is included in a UITableView for deleting rows. The other problem is that most of my screens are UITableViews so the user could be simply scrolling the UITableView. So I am wondering if I could use a two finger swipe (vertical) to detect the gesture to run the code