objective-c

Calculating minimumZoomScale of a UIScrollView

Hi, I have an image that I want to load into an image view and set the minimumZoomScale, as well as the zoomScale to an aspectFill like scale that I calculate as follows: // configure the map image scroll view iImageSize = CGSizeMake(iImageView.bounds.size.width, iImageView.bounds.size.height); iScrollView.minimumZoomScale = iScrollView...

How to make the animation like when deleting a item in iphones home screen in iphone sdk?

Hi Guys, I need a help from your side I had items like it in the home screen of the iphone.Also I am having edit button when I click on to the edit button a delete button is shown at the top left corner of every item.The need is when we have a long press in Iphone we will get delete icon at the top left corner and the each item shakes.I...

Converting .xls file to xml for webservice with iOS

Hey, am writing an application and I need to convert a .xls file to xml to feed it into a web service. All my google searches involve converting it by hand. I've not been able to find any tutorials on how to do this automatically through iOS, does anyone know of a good tutorial or even a book that includes this? Thanks, William ...

How do you remove extra empty space in NSString?

Hi, is there a simple way to remove the extra spaces in a string? ie like... NSString *str = @"this string has extra empty spaces"; result should be: NSString *str = @"this string has extra empty spaces"; Thanks! ...

How to use several viewcontrollers

Hi! I have problem concerning viewcontrollers. I have done some iphone games with just one viewcontroller, but now I want to use several. I have a MainViewController that creates two viewcontrollers called StageViewController (where the gameplay takes place) and a MenuViewController (where you select the stage you want to play). My M...

ASIHTTPRequest Problem

Is anyone else having this problem with ASIHTTPRequest? It seems that when I perform an async request from within a background thread with delegate set to the instance I can run into trouble as the delegate can be freed before the request (which is put into an NSOperationQueue) returns a callback. It seems that ASIHTTPRequest doesn't r...

concept of retain in objective c

i am new in objective c.....i am aware of alloc and release..... but dont know when and why to use retain statement...... please help....need just basic idea... please also tell something about copy statement..... ...

Add each item into string

//Parse this shit //Create array of all items in order (with submatches still NSString *myregex1 = @"\\<([a-z0-9]+)\\sref\=\"([^\"]*)\">([^\<]*)\\<\\/\\1\>"; //Get all items in an array NSArray *items = [stringReply componentsMatchedByRegex:myregex1]; //Create string to hold all items in NSString *AllOrderItems; if ([items count] > ...

Converting Actionscript syntax to Objective C

I have a game I wrote in Actionscript 3 I'm looking to port to iOS. The game has about 9k LOC spread across 150 classes, most of the classes are for data models, state handling and level generation all of which should be easy to port. However, the thought of rejiggering the syntax by hand across all these files is none too appealing. A...

Facebook-style "hyperlinks" in text

Hi there. Its been bugging me for absolutely weeks now, but I can't find out how to get links in bodies of text like in the facebook iphone app. The specific word that is a link is a different color to the rest of the text and when clicked changes color and has a gray box around it. The only way I can think is with a UIWebView - but I...

how sending message to class works in objective-c

Hi all, I am trying to find out how method calls works in objective-c. I have a simple line of code in an iPhone app, wich is changing the appearance of a view, and then a view controller is called and attached to the main view. switch(pressed) { case overall: { IPViewController *ipv = [[IPViewController alloc] initWithParam...

Use Multiple NSFormatters for the same NSTextfield

I have a textfield that I would like to use for multiple types of input. I have two custom NSFormatter classes that I would like to use for that field depending on what kind of input the user would like to provide. The input type is selected by a popup button before data is entered in the text field. I have an IBAction for the popup butt...

How can I fake superscript and subscript with Core Text and an Attributed String?

I'm using an NSMutableAttribtuedString in order to build a string with formatting, which I then pass to Core Text to render into a frame. The problem is, that I need to use superscript and subscript. Unless these characters are available in the font (most fonts don't support it), then setting the property kCTSuperscriptAttributeName does...

How to create a Static NSMutableArray in a class in Objective c?

I have Class A which is super class for both class B and class C. I need to store the objects of Class A in 'static' NSMutablearray defined in Class A. Is it possible to modify data stored in MSMutableArray using methods in Class B and Class C? How to create and initialize Static array? An example would be of more help. thanks in advance...

Stop drawing of CATiledLayer

Is is possible to stop CATiledLayer to draw (drawLayer:inContext)? It draws asynchronously and when i try to release CGPDFDocumentRef, which is used by CATiledLayer, the app crashes (EXC_BAD_ACCESS). That's my view: @implementation TiledPDFView - (id)initWithFrame:(CGRect)frame andScale:(CGFloat)scale{ if ((self = [super initWithF...

how should I draw Custom button on Navigation Bar.

Hi all. I want to draw custom button on Navigation bar. Can anybody help me. ...

Placing multiple placemark with MKReverseGeocoder

Hi, Can someone tell me if it is possible to place multiple placemarks while using MKReverseGeocoder. right now I can only put multiple placemarks while it only says "title", "subtitle". If it is possible, please tell me how. -(void)addPins:(CLLocationCoordinate2D) location { MKReverseGeocoder *geocoder=[[MKReverseGeocoder alloc] ...

How to implement "Searching" in my pdf viewer iphone application?

I am implementing a pdf viewer application with pdf loaded to the UIWebview. I want to add the functionality of "search a keyword" for the contents in pdf. ...

Using Block Completion Handler in iOS 4 for animation

I would like to animate my subviews movement when rotating the device, changing the alpha to 0, move the view to the new position and reset the alpha to 1. Using this code in didRotateFromInterfaceOrientation causes the view to flash and fade very quickly and then reappear. I would like to avoid this behaviour. [UIView animateWithDurat...

UIScrollView Rotation

I have a scrollview that automatically generates a series of subviews containing imageviews. The concept is that it's pretty much a custom PDF style reader, where each page is loaded in to an imageview as an image. There are three "layers" - the outer UIScrollView, the automatically generated subViews and the imageview inside the subview...