ios

Nib loading with View Controllers on iOS

Does anyone know the rules for default nib loading of iOS View Controllers? Specifically what naming conventions are supported by -[UIViewController initWithNibName:nil bundle:nil]? The docs, quoted below, don't seem to indicate any special magic in determining the name. However I have determined that there does appear to be some magic ...

Core text exactly same as UITextView text format?

Hi, I'm trying to set up a CTFrame that exactly matches my UITextView's text format in iPad. First of all, I converted UITextView's text to an attributed string. Then I set up a width and a height of drawing box in which Core Text will draw text. I succeeded to draw text using Core Text, but UITextView and Core Text show slightly differe...

UIScrollView event handling

Hi everyone, I'm trying to make my own custom UIScrollView for some reason. The question is, is it possible to exactly mimic the event handling behavior of UIScrollView including 'delayed content touches' and 'cancellable content touches'? That is, the custom scroll view should delay handling the event until it can determine if scrollin...

How to parse xml data which have special characters in iOS?

How to parse xml data which have special characters ( ' , " , < , > etc) in iOS? In NSXmlParser's delegate, when it reads special characters ( ' , & ), it thinks this is open new eplement? How can i ignore those special characters? ...

Is there any way to check the availability of iOS app names?

Is there any way to check the availability of iOS app names? Thanks! ...

Error when launch adhoc app in xcode 3.2.4

I'm sorry about asking this question again, I looked for many forums, websites about this issue, even if I did follow Apple's instruction at http://developer.apple.com/library/ios/#qa/qa2010/qa1710.html but it's seem helpful for me. I upraged my xcode sdk to 3.2.4 and iOS 4.1, everything is well with Development, but when I built adhoc w...

How to send selectors or blocks to an NSRunLoop to perform?

I need to guarantee that the same thread performs various actions at arbitrary times. First the thread needs to initialize a library, then I want the thread to sleep until work needs to be done and upon user input, I need to be able to pass selectors or blocks for execution. How can I setup an NSRunLoop to sleep after initialization? Af...

Why does the new iOS GameKit split between delegates and blocks?

It could be that recent revisions to GameKit are simply a tech demo for blocks. Or, that the "on return" functionality of certain GameKit APIs is just too inconsequential to deserve a dedicated delegate class, and blocks now fulfill the function of an informal protocol. Though it feels like a subjective question, perhaps there is a defi...

How sort objects parsed from XML..

so I want to parse an xml and display (in a UITableView) the "subjects" in ascending order depending on "lessons" XML: <parfumeo_kkn> <tt_timetable> <id>1015</id> <day>1</day> <class_id>98</class_id> <lesson>9</lesson> <teacher>bt</teacher> <room>V1.2</room> <subject>M</subject> <pr_id>54</pr_id> </tt_ti...

How to get one more datapoint beyond the requested data-range in core-data?

I'm working on an iPhone app which graphs a large database, accessed through core-data, in a line-chart. I'm using a tile-based approach to rendering this graph. The distance between datapoints is irregular. Each tile uses a predicate to retrieve the data that is relevant for that tile: NSPredicate* predicate = [NSPredicate predicat...

Image drawn with CGContextDrawImage is slightly transparent.

Hello! I have a transparent image that I draw strokes into and later on I draw this image over a textured background using CGContextDrawImage. The problem is that even the parts that have been stroked by a pure black color ([UIColor blackColor]) come out as slightly transparent on the textured background. The stroke looks like this: CG...

-performSelector:afterDelay: and modal view controllers

In my application, I have a login screen presented as a modal view controller. Once the user logs in successfully, the modal view is dismissed and the application's data is updated from a web service. The user can then work with the new data downloaded. Periodically, we check to see if any data needs to be synced back to the server. W...

Reload application data when the app comes into foreground?

Hello, i'm new to iPhone dev ... i'm building an app that loads data from a local sqlite3 db in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { When i tap iPhone button and put it in background and then i recall it i see (as normal) the app in the same way i leaved i...

iPad: Animate UILabels color changing.

I have a label which pops up displaying points in my application. I am using the following code to make the label get larger in scale, then smaller. I would also like to animate the color changing from purple to green. Can someone point me to a resource in achieving this? mLabel.textColor = [UIColor purpleColor]; [UIView beginAnimatio...

mirror an mpmovieplayercontroller to tvout

I am looking for a way of mirroring videos to the TVOut on an iTouch, not in fullscreen. For my code, I have used Rob Terrell's screen mirroring example here: http://www.touchcentric.com/blog/archives/123 and this one as well: http://www.e-string.com/content/screen-mirroring-ipad I have used image = UIGraphicsGetImageFromCurrentImageCon...

iOS crash reporting, e.g. during beta testing

I'll be ready to start beta testing my iPhone app in the next month, and I guess I should be expecting it to crash once or twice. It would be nice to get the crash report -- and whatever supporting info I can -- back to the mothership. Ideally, this would require little to no work on the part of the beta testers. There are tools and met...

2 touches problem

hello all recently i used this codes to handle drag touches : - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event - (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event but my problem when the user touches 2 buttons at the same time only one cal...

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...

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 ...

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...