objective-c

How can I render different paragraph styles in Core Text?

Hi, I'm having a difficult time trying to work out how to build a page using Core Text, where I have multiple paragraphs which follow one another, but in different styles. In other words, I would like to have a title paragraph, followed by a subtitle paragraph, followed by several body paragraphs. In HTML terms, this would be: <h1>Som...

repeat an image when scrolling on iphone

Hi, i've got an UIImageView, now i want to repeat this image, that it always shows up again when scrolling left or right. Little Example: is this possible? it should feel like an infinite loop ...

asking if user wants to use Location Services

How does the process of "asking if user wants to use Location Services" work? I read here that a dialog at the installation appears, which asks the user if Location Services should be allowed or not. Does it mean that there is nothing to do for the developer, because the user can change this behavior in settings? So there is no "asking ...

Do I need to create variables and link IBOutlet for every UIVIew?

I have a View Controller that is swapping UIView objects in and out. There is the potential to have hundreds of different views, each with their own behaviors. Within my current MainWindow.xib file I currently have: File's Owner UIApplication First Responder UIResponder AppDelegate AppDelegate -Cover Cover Window...

search within NSstring

hi, i have a NSString that is of the follow : Hello (\n) (\n) No.: 123456789123 Age: 21 (\n) Country: xxx how can i search within a string so that i get "123456789123" as a new string? thx in advance ...

Use Java library with Xcode, Objective C, and Cocoa

I would like to use an open source library that's written in Java to create a Cocoa desktop application. Ideally, I would use the Java library as the model, and write my own Objective C controller classes and Cocoa views. Is this possible in Xcode? What options do I have (if any)? Or, would you recommend rewriting the parts of the ...

How to change UIView size in Interface Builder

In Interface Builder when I look at the size inspector for the view, it's showing 320x416 and it's grayed out so I can't change it. How can this be made editable? ...

Placement of "good" control points in Bezier curves

I've been working on this problem for awhile now, and haven't been able to come up with a good solution thusfar. The problem: I have an ordered list of three (or more) 2D points, and I want to stroke through these with a cubic Bezier curve, in such a way that it "looks good." The "looks good" part is pretty simple: I just want the wedge...

Convert Interface Builder code to XCode

Is it true that everything you do in Interface Builder can be done programmatically? If your project uses Interface Builder to make the GUI, can that code be converted to native XCode and inserted into the project? ...

What is the maximum image resolution supported by the UIWebView?

I would like to put a giant image in a UIWebView and let the user pan around in it. However it seems that the UIWebView automatically will scale the image to save memory? Is this correct? ...

calling a method of current class from a method of another class

Hi, I am working on a class A which has a method -(void)DoSmthing1. I am making a call to another method-(void)DoSmthing2 in class B. Now after doing some operations in class B, the method is supposed to call back a method-(void)DoSmthing3 previous class. How will i call a method of current class from another class?? Can someone pleas...

Getting rid of link-click "flash" indicator in iOs UIWebView.

My iPad app uses a lot of UIWeb views to display content. The user clicks small images with links to pull up a smaller view with additional content. When you tap a link in a UIWebview, the link highlights gray for a moment to indicate the click. In the case of links in an in an image, the whole image rectangle flashes gray for a moment, ...

Switching nib files

I have a View Controller inside my MainWindow.xib file that loads the nib "Cover" when loaded. Cover (and the rest of my pages) is simply a nib file containing it's Owner, First Responder and a View. There is also an associated class declaration. In MainViewController.m I have: - (void)viewDidLoad { [[NSBundle mainBundle] loadNib...

How to make keyboard appear at top of screen

When the user touches a UITextField a keyboard normally slides up from the bottom of the screen. Is there a way to make the keyboard appear at the top of the screen instead of the bottom? ...

How to click a checkbox in nstableview and update an object using KVC? Still a problem...

Hi all. A few days ago I posted a problem with using checkboxes in nstableview (old question). Peter Hosey helped me, but I am still unable to get this to work. I seem to be doing something very wrong with implementing a button that shoud be straightforward. I have a tableview with three fields; bool, text, and text. The values of each c...

Does NSXMLNode's nodesForXPath:error: guarantee a specific ordering?

I extract nodes from an XML document by calling -nodesForXPath:error:. Now i wonder if it guarantees, that the nodes are returned in the same order as they appear from top to bottom in the document (it's crucial in my case). My XML looks something like this and i retrieve the b tags with the XPath query: <a> <b> ... </b...

How to get indexes from NSIndexset into an NSArray in cocoa?

I'm getting the select items from a table view with: NSIndexSet *selectedItems = [aTableView selectedRowIndexes]; what's the best way to get the indexes in a NSArray object? ...

Comparing time in NSDate

I am trying to compare the time from two NSDate objects but am getting the wrong answer. I think it is because when using the NSDate compare methods it is also including the date. I just want to ignore the date and compare the times. How can this be done? ...

Using a table view for entering data

With the regular table view touching a table cell will switch to another view. I have seen some applications that are using something that looks similar to a table view except touching a cell brings up the keyboard so that text can be entered into the cell. It looks kind of like a table view, but a little different. What are they using t...

Update plist file in File Sharing folder - I really need advice

I need to open a plist file located in the File Sharing folder, to add two pieces of user info to each time the app is launched; as in a new Name and Email of the user (both are of type NSString and the plist file is Dictionary). It then needs to save the file back to the File Sharing folder again, so that the new updated plist file can...