objective-c

UIScrollView Rotation Issues

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

Which Cocoa Touch control is this (screenshot)?

Hi, I'm seeing these all over the place but I'm wondering what controls are used here? What is the thing with the arrow pointing right? Is it a UIRoundRectButton with a ">" (greater than) character? What is the box with the rounded corners below which allows separaring content using a horzontal line? Also looks like a button... Th...

Confused why one piece of code works and another doesn't in Objective C

Sorry about the title being extremely vague, I'm new to Objective C and struggling a little with it. Basically I have the following section of code: Graph *graph1 = [[Graph alloc] init]; [graph1 addNode:@"TEST"]; which is working to a degree. But I want to change it because the above code happens on a button press, and therefore I ass...

why Custom alertView is not called?

I have a class file which is subclass of UIAlertView and adding image in alertView.But the problem is that when i call it the application crash.Here is my class CustomAlert.h #import <UIKit/UIKit.h> @interface CustomAlert : UIAlertView { UILabel *alertTextLabel; UIImage *backgroundImage; //UITextField *nameTex...

Memory management question

Hello all, I wanted to clarify something: I.e when I add a UIVIEW To i.e another UIVIEW programatically. i.e [theview addsubview:thechildview]; I need to release thechildview because theview increments the retain count. Right? So basically if I have a loop and I am using that loop to initialise subviews and add the subviews to a vie...

Empty Response with ASIHTTPRequest on WebService

Hello, I have some trouble getting a response using ASIHTTPRequest which is quite nerve-wrecking. I am sending a SOAP Request inside the POST-Body of an ASIHTTPRequest to a server. The Request is sending fine so far but the Response String is "(null)" according to the Console and the Length of the response Data is 0. However, when I sen...

extract specific string in NSString

hi, i think it is a simple question but i dont know how to solve it. i have a NSString that containes html content. i want to extract some tags. NSString *string=@"test some text <img src='http://www.xyz.com/a.jpg' > blah blah <a href='asdfg'>aaaa</a> bbbb cccc"; i want to take img & "a" tag into new string. then i will display it i...

NSMutable Array and leaking Problem

Hey - does somebody know why i get a leak when i use this line of code ??? : [self setModules:[[aDictionary objectForKey:KEY_MODULES] mutableCopy]]; Thanks in advance pk ...

Exposing Objective-c object to JavaScript environment in JSON format

I want to represent any objective-c object in JSON format at RUNTIME, so that a javascript script can use it to access any field/variables/properties through 'dot' notation. For example, Objective-c class for the object could be: @interface myNativeObject PrimtivieType *pVar; CustomClassType *cVar; @end Where CustomClassTyp...

Creating a UITextField that works like the iOS Mail's "To" field.

In iOS's Mail app, when you enter in the email of someone who is in your contact list it formats the text in an interactive bubble. I can't seem to find any obvious way to do this, and it's exactly what my app needs to do, and I'm not even sure where to start. Any pointers to where to look would be appreciated! ...

NSFileHandle fileHandleForReadingFromURL can someone explain this to me please?

I am trying to make a customized input stream based off of the one by Dave DeLong here that also allows for reading data from a server via NSURL. So far, I have this approach, which works fine for local files: @interface RJRStreamReader : NSObject { @private NSFileHandle *fileHandle; NSStringEncoding encoding; NSString *...

UITableViewCell not displaying data

Hi I am calling - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CustomCellIdentifier = @"CustomCellIdentifier"; CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CustomCellIdentifier]; if (cell == nil) { ...

TextFieldDelegate being deallocated too early

My program is crashing because my TextField is sending messages to its delegate after the delegate has been deallocated. I have an object that serves as a UITableViewDataSource and a UITextFieldDelegate. In cellForRowAtIndexPath, I create a TextField inside each TableViewCell and assign self as the TextField's delegate. When I click a bu...

GtkFileChooserDialog in Cocoa

Hi, I justa want to know if there's a class like GtkFileChooserDialog in Cocoa. This class is used in gtk for opening a file. ...

UITableView loads data too early... or too late

I have a UITableView that changes its data very often. (It's just NSStrings, stored in an NSArray.) Method 1> [self loadMyArray]; Method 2> [myTable reloadData]; Where would I put those 2 methods... so they get called EVERY time the view is displayed? I assume some likely places would be: viewWillLoad viewDidLoad viewWillAppear vie...

iOS Launch Images for UITableView

According to the iPhone Human Interface Guidelines every app needs a launch image. My app is just a navigation controller which contains a table view. How can i simulate an empty tableview and navigation bar as per the guidelines. "Simulate Interface" in IB fills the view with the standard California data. I tried creating a basic navig...

Problem with IB

This is my first post on SO, so hi! I'm new to Xcode and Obj-C too so don't be too harsh. I am following the demo from Standford University youtube.com/watch?v=L-FK1TrpUng For some reason i've hit an error. Rather than starting from scratch i'd prefer to figure out where I have gone wrong. Ok so here goes. I have two view controller...

How to comment Apple's block extension for Doxygen 1.7.2?

Doxygen annouced in their changelog for version 1.7.2 to support Apple's block extension. I wonder what the syntax is to generate the documentation. I could not find any hint - also not in the Doxygen configuration file (version 1.7.2). ...

How to write an xcode user script to surround the string the cursor is inside with NSLocalizedString(<string>, nil)

Hi all, I'm trying to figure out the best way to automatically add NSLocalizedString() around a string in xcode. Ideally I'd like a way that I could position the cursor within @"foo", press a key binding, and it'd be turned into NSLocalizedString(@"foo", nil). I've had a look at the documentation for user scripts and can't see an obvi...

Simulate key press events for ioquake3 in Mac OSX

Hi, I am currently writing an application which simulates key press events in Mac OSX to control ioquake3. My current approach is to create the key press events with the Quartz Event Services. This works fine with e.g. TextEdit but not with ioquake3. CGKeyCode keyCode = 126; // 126 is the "up" key CGEventRef event1 = CGEventCreateKeybo...