cocoa-touch

Memory leak when using UIwebview

Hi! Im in the final stages of my first iphone sdk project. I have been working hard to remove memory leaks from my app, and have mostly succeeded at it. But there I am struggling with one of them. I have a contact screen with a button that fetches a webview, but only if there is a network connection. If not an alert pops up. This works ...

UITextView selectedRange not displaying when set programatically

My problem is that programatically setting the selectedRange of UITextView selects the text, but does not visually indicate it's selected. Does this sound like a bug in OS 3.0/3.1. More importantly, any solution or suggestions for getting the selection to display? (sample project linked at bottom of message) How do I know it's selected ...

Variable height UILabel

I'm working on a iPhone product page where some of the fields can be fairly long (product name etc.) I've created the page layout in IB, and use UILabels to show the text fields. For those long text labels I'd like the height of the label to scale and push the other labels further down. Is this possible using IB, or would I have to do ev...

Can tabbar appear only on first view?

Would I violate the HIG by showing a tab bar on my first view only? The first view also has a tableview and navigation bar at the top. Once the user selects a row, it goes to another tableview and no tab bar. The navigation bar is still at the top and the user can go back. Clicking a row from here displays the detail view. In summary...

Different alpha for subviews in the same container

I have a question similar to the http://stackoverflow.com/questions/1269637/can-you-override-a-parent-uiviews-alpha-value-on-one-of-its-subviews In some cases I want to show custom semi-transparent full-screen overlay view over current view. The trick is that I want it to have custom navigation bar at the top and some other contents (le...

Promo code for in app purchase items

Apple doesn't provide promo codes for in app purchase products. My content will be in an sqlite database in the app. I'll use a column flag to indicate purchase status. Once the user purchases, I unlock the row by changing the flag. Would it be easy enough to provide another interface so the user can enter in a code and unlock the it...

%d doesn't show integer properly

As I try to write NSLog(@"%d", myObject.myId); where myId is int, console gives some hight number like 70614496. And when I use @"%@", I get exception -[CFNumber respondsToSelector:]: message sent to deallocated instance 0x466c910. Why is it so? Here's definition of myObject: @interface myObject : NSObject { int myId; NSString *titl...

UIScrollView only works if the child views aren't hit

I have a scroll view that doesn't scroll right, I've simplified the code for below. It draws the view and some horizontal buttons that i add more stuff to in the real code. If you drag the whitespace between the buttons the view scrolls. If you happen to put your finger on a button, it won't scroll. After a related suggestion, I tried...

Downloading image into bundle?

I display text and images in a UIWebView. Content isn't always the same. I access images within the content using the bundle path. For an inbetween versions update of content, I'd like to allows users the ability to download new content (text & images). This new content will also display in a UIWebView. The problem is I will have to...

Will UIView autoResizingMask handle a navigation bar which may or may not be there?

I have a UITableViewController which displays its own top navigation bar when it's presented modally, but uses the UINavigationController navigation bar when it's pushed onto the navigation stack. I currently have code which programmatically moves origin of the table view depending on whether it has the navigation bar. When it uses its...

CoreDataGeneratedAccessors - removeObject does delete the object ?

When I generate my classes from CoreData entities I get generated methods @interface Site (CoreDataGeneratedAccessors) - (void)addSearchesObject:(Search *)value; - (void)removeSearchesObject:(Search *)value; - (void)addSearches:(NSSet *)value; - (void)removeSearches:(NSSet *)value; @end So my question is pretty simple when I call rem...

How to get the center of the thumb image of UISlider

I'm creating a custom UISlider to test out some interface ideas. Mostly based around making the thumb image larger. I found out how to do that, like so: UIImage *thumb = [UIImage imageNamed:@"newThumbImage_64px.png"]; [self.slider setThumbImage:thumb forState:UIControlStateNormal]; [self.slider setThumbImage:thumb forState:UICo...

UIButton subclass continuously highlighted after an popping up and UIAlertView

I am subclassing a UIButton and detecting finger movements, if the user swipes his finger in a certain way I will pop up an UIAlerView. All good, except that after dismissing the UIAlertView... when the user next touches the UIButton the button goes to it's highlighted state and gets stuck there, continuously highlighted, even when no f...

iPhone - SSL connection

What is the best starting point to learn connecting to ssl web services by iphone? Until now i did some basic connections over http via SOAP etc. but i have no experience on https. Any good sources, tutorials, starting references, "use nsurl...class"s are appreciated ...

Return Key Text Field? - iPhone SDK

Hey guys, I've been searching the web for a really long time, and I can't get this to work. On my text field I have, when I click on it and then press done or return it won't go away. I've done all the steps for every single tutorial but I still can't get it to work. I'm on firmware 3.1.2, but anyway here is the code in my ViewControlle...

Sending user to nested view

When a user shuts down my app, I'd like to send them back to where they left off. The app starts on a tableview, the user drills down to another tableview and then clicks a row for a detail view. When they startup the app again, I have two choices: 1.) Display options (alertview) for returning to the previous location or cancelling an...

UIAccelerometer doesn't send events to second delegate

I am developing a game that uses a different controller for each level. It needs to detect a shake via the accelerometer, so it registers itself as a delegate like so: UIAccelerometer *accel = [UIAccelerometer sharedAccelerometer]; accel.delegate = self; accel.updateInterval = kUpdateInterval; When the level ends, this controller get...

why does viewDidAppear not get triggered?

i have a root view controller that inserts a subview at index 0 at its viewDidLoad method. i am trying to get the subview to become firstResponder, but can only do this - from my understanding - in the subview's viewDidAppear method. here's the line of code i added to the root view controller's viewDidLoad method: [self.view inse...

Nonintrusive visual cue for uitableviewcell

I'd like to mark a tableview row in some way that shows it has been clicked by the user. I have a large number of rows and want users to know if they have already visited a particular row. This same technique will be useful for identifying row new entries as well. I have two questions: Would such a subtle technique violate the HIGS an...

Accelerometer shake make sound only once?

I'm trying to implement a function that detects a user shaking his/her iPhone, and then the app will make a barking sound. So far I've got the code attached below, and it works. But, if I shake the phone harder, it makes 2 or more barks one immediately after the other. How do I make sure this only happens once per shake, no matter how ha...