objective-c

How to USE external C functions in Objective-C with UITextField and UITextView ;-)

Hello, Again I'm trying to wrap my head around Objective-C and Cocoa. So I've posted some code below. What I'm trying to do is basically use the function "th_brk_line" by entering text into a UITextField then displaying it into a UITextView once it has been processed by "th_brk_line". I've posted the external function definition and the...

add photo, custom uitableview

Hello all, How to design a tableview similar to contact application in iphone......... and also how to implement add photo image from local photo library which is there in contact application.... ...

How to integrate sliding pannel control used in Twitter?

Hi! I want to Integrate Sliding Panel Control Like used in Twitter so i can i integrate it.Give me some idea and Sample code if anybody integrate it.Thanks in Advance. ...

CGAffineTransformRotate starting from a new transform everytime

Hi guys, In my code I have a table, and in my table I have a slider which I transform so that it is vertical. metricSlider.transform = CGAffineTransformRotate(metricSlider.transform, 270.0/180*M_PI); But every time the code gets called to draw the slider, it of course applies the transform on top of the previously applied transform. ...

How do I split a till receipt using a Regular Expression?

The last time I used a regular expression was 2 years ago and even then it wasn't something I considered to be the simplest of things! Could anybody tell me how I would go about splitting this text into three groups (qty, name, price)? 1 Corn Dog 5.00 3 Corn Dog 15.00 @ 5.00 2 Diet Cola 4.00 ...

My userlocation-pin keeps appearing

Hi, I have a map with a userLocation. I want to show the user location when the map is being loaded. and after that I don't want to see it anymore. Why does it keeps popping out? please help ...

Why are some entities NSManagedObjects and some named after their class?

I've noticed that in my Core Data data model, some entities are (in the top-left panel) have a class of 'NSManagedObject' and some are named after a class (Person, Company etc). There doesn't seem to be any logic in whether the entity has a class of NSManagedObject of Person etc. And my code seems to work ok. So I'm wondering why there i...

How do I get the source application from an Apple Event?

When another application asks my application to open files, I need to find out which app is the source, because different courses of actions are taken. In - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames the code is currently: NSAppleEventDescriptor *currentEvent = [[NSAppleEventManager sharedAppleEventManag...

How do I obtain information about the pages in a UIScrollView?

I have a run of about 10 different methods, they all pass "page" and "index" between them in order to define a ScrollView with multiple pages. The majority of these methods run within a loop (for each page). I'm working on a way to re-orient and re-position the pages depending on the device orientation. My trouble now is trying to get a...

how to use the animation which is used to reveal the lower view?

Hi, does somebody know how to use the animation which is used to reveal the lower view(Map,Satellite,Hybrid, List) in the maps applicaton? Thanks in advance, -s. ...

Checking for nil before releasing an object

Is this good or bad practice? if (!theConnection && !receivedData) { // release the connection, and the data object [theConnection release]; // receivedData is declared as a method instance elsewhere [receivedData release]; } ...

How to access controller items in view when created programatically?

Hi - I'm fairly new to iOS programming, I've just managed to make a view completely programatically (no interface builder)...but now I'm wondering how I access the different elements such as a UILabel or UISwitch etc. In IB I'd just connect them up to their respective outlets / ibactions, how do I do it when I've created it the view from...

How to access Object ID Identity attribute

HI guys. Part 1. In the IB under Identity tab you can find an attribute called "Object ID". I can not find a way to get hold of this ID from code. Oh, and I know about the tag attribute but it's not what I need. Part 2. I essentially would like to get the unique object ID for a UIComponent that was touched on the sceen. I already have ...

Extending UIVIewController of my own I got error accessing self.view

I have created a View controller with some methods I need to use often in different aplications. It works like a charm if I use it directly but when I try to create another UIViewController that extend my class I cannot access self.view anymore. This is the init method of the original class: - (id)initWithNibName:(NSString *)nibNameOrN...

face distortion

i want to do aface distortion effect to an existing human photo picture in objc any example or tutorial anybody can point to ? ...

Objective-C catch specific type of exception

Hi, I (as some of you know from my other questions :)) am building a cocoa-touch static library, and I have the code [NSException raise:@"This is the name of my exception" format:@"This is my format", nil] scattered throughout my project as a shortcut to subclassing NSException. This is coming back to bite me, as that I need to catch ONL...

How to calculate the time taken by one process in objective c?

Hey there, I am fresh to iPhone development and Objective C. Sorry if this question is too stupid.... Here is my problem, I want to calculate the time taken by one of my function. like UIGetScreenImage. Here is the code: -(void)screenCapture{ CGImageRef screen = UIGetScreenImage(); UIImage* image = [UIImage imageWithCGImage:scree...

I am Using the default UITableViewCell .I want to set the image on cell from my local server...cell.imageView.image

BLImageCache *sharedImageCache = [BLImageCache sharedInstance]; NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:indexPath ,@"IndexPath", nil] ; NSString *urlString; urlString = [[mNewsArray objectAtIndex:indexPath.row] objectForKey:@"imgUrl"]; urlString =[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8Str...

Drawing over an NSCollectionViews subviews

I have the following code in an NSCollectionView subclass: -(void)drawRect:(NSRect)rect { if(!NSEqualRects(highlightBox,NSZeroRect)) { [[NSColor colorWithCalibratedRed:1.0f green:0.2f blue:0.2f alpha:1.0f] set]; NSRectFillUsingOperation(NSInsetRect(tempHighlightBox, -1.0, -1.0),NSCompositeSourceOver); ...

Difference between add to target & add to project in XCode

I am trying to inegerate Google Toolbox for mac for unit testing purposes on this page http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting is says add blahblah.m file to your target & add blahblah.m file to your project. What is the difference, how should I add to target... ...