iphone

self.tableview reloadData causing crash in UITableView

I'm getting this crash when selecting a row: '-[__NSCFArray objectAtIndex:]: index (1) beyond bounds (1)', I moved the data out of the viewWillAppear because we though it was causing a crash. I now have it loading on ViewDidLoad. However if the [self.tableview reloadData]; is on, I get this crash. Ideas? -(void) loadData3;{ ...

Which is the actual view i can see on my iphone?

Hi.. How can a check which is the actual view i can see on my iphone? thank you! ...

What is the Interface Builder keyboard shortcut to rotate a window?

In IB, I can rotate a window by pressing the "arrow button" at the top right of a window to see a view in landscape/portrait modes. What's the keyboard shortcut to toggle this action? ...

Why is UIView exclusiveTouch property not blocking?

I am launching a simple UIView with a textField - let's call it orderSetNameView - upon a button tap. I wish to make this view modal, but without using a [UIViewController presentModalViewContoller:animated:]. It seems I could simply set textInputView.exclusiveTouch = YES to achieve that. Apple documentation says about exclusiveTouch,...

Open iTunes from an UIWebView

How can I open the iTunes App Store from an UIWebView? what code (javascript?) should i use? ...

In-app purchase of credits to be used in external website?

I'm thinking of implementing in-app purchases for my iphone app. My question is whether or not I can implement a credit system. I'd like to allow users of the app to purchase various quantities of credits. The credits would then be stored in a DB for that user's account. The user can then visit a dedicated website for the app and use the...

Porting AS3 to iPhone App

Anybody know any good tut's for iPhone development? I have written a game in AS3 and have excellent knowledge of PHP/OOP etc but I cannot get my head around the iPhone SDK or the objective C syntax and structure. ...

What is the difference between compare: and isEqualToString:?

I was working on this: NSString *str1 = @"This is string A"; NSString *str2 = @"This is string B"; NSComparisonResult compareResult; if([str1 isEqualToString:str2] == YES) NSLog (@"str1 == str2"); else NSLog (@"str1 != str2"); compareResult = [str1 compare: str2]; if (compareResult == NSOrderedAscending) NSLog (@"str1 < ...

Having trouble getting UIView sizeToFit to do anything meaningful

When I add a subview to a UIView, or when I resize an existing subview, I would expect [view sizeToFit] and [view sizeThatFits] to reflect that change. However, my experience is that sizeToFit does nothing, and sizeThatFits returns the same value before and after the change. My test project has a single view that contains a single butto...

iPhone Autorotate: Replace rotation animation with fade-in/fade-out?

Someone else asked a similar question previously, but I am interested in knowing whether the autorotate feature of the iPhone SDK will allow us to replace the rotation animation with another transition, such as a fade-in/fade-out. For a modal view, we can set the modalTransitionStyle but there is no such property for autorotate. If I c...

Remove all objects after index 20 in NSMutableDictionary?

Hi! I have an NSMutableDictionary that possibly contains more than twenty objects. If it contains more than 20 objects, how should I remove the oldest entries until there is only 20 left? For example, NSMutableDictionary with objects: a = "-1640531535"; b = 1013904226; c = "-626627309"; d = 2027808452; e = 387276917; f = "-1253254618"...

Is this the best way to alter a UIView's frame for an existing view?

Lets say that I want to temporarily change the frame of a view (for eg move it 10px to the right - probably in connection with highlighting a change). I assumed the psuedo code would be something like self.someView.frame.origin.x += 10.0f; But this gives me an error of lvalue required as left operand of assignment So what I do ins...

UIImagepickercontroller: is it possible to change the sort order of the images in camera roll?

Basically the app im working on would be a lot less of a pain if users didn't have to scroll to the very bottom of their camera roll to get their most recent photos, I want the most recent at the top, wouldn't this make sense anyway? Not sure why apple designed it this way, or if im just not realizing something. Thanks nick ...

Cocoa Touch: How to add a subview that is centered horizontally in its parent view?

Hi, my subview (childView) has a smaller width than the parent view. [parentView addSubview:childView]; I'm wondering how I might be able to add this child centered horizontally (vertically I want it to remain the same) in the parent view. I'd like to do this in code. Right now it's adding but to the top left corner of the parent. an...

iOS - Drag and drop collision detection How to detect when your selected item drags over another subview?

We are adding drag and drop functionality to what is to become a sports field with positions for players. The positions are mapped out using Interface Builder with each being a separate UIImageView. We want to be able to drag player images from bench positions from the side of the screen onto positions on the field. How best can we d...

Iphone- How to resize view when call status bar is toggled?

Hello Guys, I'm creating an iphone app with few elements inside the controller (e.g tab bar, uiview, uitoolbar, etc..). Everything works fine until I encountered this problem. While my application is launched, I received a call and it shows the "Call Status Bar" which ruined the ui. Some elements are pushed down because the "Call Status...

Possible to use two separate SQLite databases?

I have one sqlite database in which I store both user-defined information and information which is read-only to the user. I feel like I may need to modify the read-only information in the future, and I don't want to have to do a whole data migration. Is there a way that I can use a separate sqlite database, which can easily be replaced, ...

Half of UIButton not responding to touch events

I have a UIView - which I am using as a makeshift toolbar. It contains several UIButtons. (Six, I think) in a horizontal row. The fifth button over will only respond to [TouchUpInside] events when I click the left half of it - whereas all the other buttons work correctly. I have gone crazy making sure there weren't any other views over...

Unable to simulate a touch on the iphone album

I've been trying really hard (with no success) to generate a touch event in the private "PLAlbumView" class (which is the class where the picture thumbnails are displayed). I've been trying to do that in order to test an End-To-End scenario on an iPhone application I've been working on that uses the camera. So far, I have tried mimicki...

Read sound from library

How can i get sound from iphone/ipod library?(means like read photo from photo library) ...