iphone

View is not animated when it's removed from superView

I try to remove a view from it's superview after being animated offscreen. But it seems when I add the removeFromSuperview call after when the animation is supposed to end, the view would no animate at all but instead disappear instantly from the screen. So why is there no animation when I add the [[self pickerView] removeFromSuperview];...

Putting NSString into uint8_t buffer

I'm working with sockets and trying to simply write a string to the socket. I found a couple of examples on how to do this, such as the following example (oStream is an NSOutputStream). This is all within the NSStreamEventHasSpaceAvailable. uint8_t buffer[11] = "I send this"; int len; len = [oStream write:buffer maxLength:s...

How to get an x and a y for a CGRect to initialize a control with a frame?

I'm programming an iPhone app and I'm wondering how programmers properly position controls without using Interface Builder. More or less, this is because I want to position a couple of controls without using Interface Builder. Thanks! ...

From willAnimateRotationToInterfaceOrientation how can I get the size the view will be after rotation?

I am trying to resize the objects in a UIView when the device is rotated without hard coding the width and height. In this code how would I get the newWidth and newHeight? - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { child.frame = CGRectMake(10, ...

iPhone - Handling Memory with Multiple Views

Hi, Here is a piece of code from the exploring the iPhone SDK book. It uses the example of 2 views. It checks to see which view is being used and will release the other one. - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it // doesn't have a superview // Release anything that's ...

Getting page background to continue on iPhone

I have a background image repeated from top to bottom, and on PC it looks fine, but on the iPhone or droid it does not continue. The footer is above the bottom of the page and the page background does not continue on the iPhone/Droid but it sits at the bottom on a regular computer webpage. Any tips? ...

How to add a drop shadow to a UIButton?

I would like to add a drop shadow to a UIButton. I tried to use self.layer.shadow* properties. Those properties work in UIView, but they behave differently in UIButton. I would really appreciate it if I could get any pointers to draw the drop shadow. Thank you! self.layer.cornerRadius = 8.0f; self.layer.masksToBounds = YES; self.layer.b...

In Objective-C, why does this increment by 4 instead of 1?

In Objective-C, I have a simple block of code that increments a counter each time a button is pushed. My logs, and even updates to the interface, are showing an increment of 4 instead of one. Is this just a display issue with my formatting (I'm using %d) or something else I'm missing? My guess lies with the "%d" but I'm new to Objective-...

CGFloat causes iPhone Unit Testing Bundle to fail build

I'm having problems getting an iPhone Unit Testing Bundle to compile when the code it references uses CGFloats. If I recall correctly, CGFloat is just a pre-processor macro so I'm guessing it's not getting replaced properly, but as I am relatively new to this iPhone caper I have no idea where to start looking to fix it. I've already comp...

iPhone AsyncSocket always connecting on any port!

Hi there! I'm using (or trying to...) AsyncSocket to connect to a server but it always connect even if the server is not running... I'm using the SDK 3.1.2. Anyone faced this problem before? #import "mluPresenterAppDelegate.h" #import "AsyncSocket.h" @implementation mluPresenterAppDelegate @synthesize window; #pragma mark - #pragma ...

Load more function in Javascript

EDIT: This question was initially too general, I think. So What I really need is a very good tutorial on how to implement the Load More function on Safari for iPhone just like the Twitter website(mobile.twitter.com) does. Just a wordpress plugin won't really help. But if the plugin is well explained, like if it is wptouch, home(that also...

iPhone SDK - make UINavigationBar transparent

How do you make a UINavigationBar transparent? Though I want its bar items to remain visible. ...

How to store custom objects in NSUserDefaults

Alright, so I've been doing some poking around, and I realize my problem, but I don't know how to fix it. I have made a custom class to hold some data. I make objects for this class, and I need to them to last between sessions. Before I was putting all my information in NSUserDefaults, but this isn't working. -[NSUserDefaults setObje...

How do I make a triangle space with text written for the iPhone?

I want to draw a triangle and elide text in the shape. I can restrict the triangle to an equilateral triangle and a fixed orientation ('upside down' or 'upside up'). Then I want to insert arbitrary text in the triangle such that the eliding is on word boundaries and not clipped. Any simple algorithms? What methods are available in Ob...

what is JAva 's LWUIT equivalent for iPhone?

Lightweight User Interface Toolkit (LWUIT) is used as UI system in Java. What can be the equivalent for this concept in iPhone? ...

Accessing Child.plist of Settings.bundle in iPhone application - How?

Hello ! Every one here. I am facing a problem in accessing Settings.bundle. Let me explain what exactly I am doing. Any kind of new Project Template from File ( Under iPhone OS ) - preferable View based. Now Right click on your project / Resources group. Select Add / New File Under iPhone Os - resource - Settings Bundle. Name it as ...

how to capture photo using camara in sdk 3.1?

photoPicker.sourceType = UIImagePickerControllerSourceTypeCamera; //or album photoPicker.allowsImageEditing = YES; When i write above syntax then i get warning allowsImageEditing is depricated in sdk 3.1. ...

Calculate Dip and Strike.

Hello All, How do i calculate Dip and Strike from iphone. They are used to measure rocks. i have to use compass api how do i get the angle from it. anyone has idea please give me some idea. Thank you. ...

show pins around 100kilometers

Hello People, i am implementing an app, that show customers and my userLocation on a map. But now i have a problem, because there are a lot of costumers and the map is very uncomfortable. How can i only see pins on a map or in a list, that are around 100 kilometers away from me? I hope someone could help me? Greetings Marco ...

How to draw bordered letter ?

Hi guys, I am searching about drawing bordered text on UIView. Implemented following method : - (void)drawRect:(CGRect)rect { //TODO draw bordered text here. } How to draw it ? I mean each letter is bordered of whole text. Thanks in advance. ...