iphone-sdk-3.0

NSArray - check if objects are in an array?

左心房为你撑大大i 提交于 2019-11-28 10:00:03
问题 I have 2 arrays. One is a large static group of 600 objects, the other is a small varying group of 10 objects. I want to take any common objects between the two groups and put them in a new array. So lets say the large group contains 600 objects named 1 to 600. The smaller group contains 9 objects: 1, 2, 3, 4, 5, 6, a, b, c. I want to be able to create a new array that contains the objects 1, 2, 3, 4, 5, 6. What is the best way to do this? 回答1: Are you sure that you need NSArray s? For

strange GDB error unable to trace

孤街浪徒 提交于 2019-11-28 08:58:58
问题 I am getting this strange error in gdb and i'm unable to trace the exact line of code to trace the bug. Does someone knows about this type of bug? Here is what i get in gdb *** -[CALayer sublayers]: message sent to deallocated instance 0x911c2a0 (gdb) po 0x911c2a0 Program received signal SIGTRAP, Trace/breakpoint trap. 0x020993a7 in ___forwarding___ () The program being debugged was signaled while in a function called from GDB. GDB has restored the context to what it was before the call. To

App not installed…because its resources have been modified

别说谁变了你拦得住时间么 提交于 2019-11-28 08:39:11
问题 One user cannot install my app because they continue to receive the error: The application “myapp” was not installed on the iPhone “myPhone” because its resources have been modified I've read the error occurs because of adding files after the app is built. I have not added any files. Last week, the user could install the ad hoc without issue. I've tried clean and rebuilt with no luck. As the developer, the ad hoc installs fine on my device from iTunes, even after deleting all profiles. Any

Problem dismissing multiple modal view controllers

穿精又带淫゛_ 提交于 2019-11-28 08:25:34
I am having trouble getting my modal view controllers to display properly. I have a parent view controller that is the delegate for modal view A . In modal view A I am presenting modal view B, and having the delegate dimiss modal view A. When modal view B appears it seems to display but the screen dims, and the UI locks up, but the app doesn't crash. I set animation settings to NO and I am still getting the same issue. Order of events: Parent View show Modal View A Modal View A shows Modal View B in Modal View A controller Parent View dismisses Modal View A in Modal View A controller via

How to set selected segment index in UISegmentedControl?

柔情痞子 提交于 2019-11-28 08:02:32
I'm trying to avoid an app crash here... I have a button that will remove a segment from a UISegmentedControl. If that button is pressed and the user has the segment to be removed selected, the segment will remove and no selection will be highlighted. However, when another button is pushed that does an action that retrieves the selectedSegmentIndex, the app crashes. In short: Is there any way to force the selection of a segment in a UISegmentedControl? edit it seems as though the UISegmentedControl is returning a selectedSegmentIndex of -1 when no segment is selected... let's see what I can do

iPhone - How do you make a resizable rectangle for cropping images?

陌路散爱 提交于 2019-11-28 07:51:59
I'm having a trouble making a re-sizable rectangle for cropping my images. I'm trying to achieve something like this picture: http://img192.imageshack.us/img192/8930/customcropbox.jpg Well, the only problem is I have no clue where to actually start. I need some advice to how I can achieve this effect of cropping. What documentation should I read up on? Core Graphics or Quartz 2d? Both? I've been coding for the iPhone since it's release date but I've never actually used core graphics and etc. Any help or advice would be much appreciated. I'll throw my code up here as I progress to show how it's

Displaying ppt, doc, and xls in UIWebView doesn't work but pdf does

送分小仙女□ 提交于 2019-11-28 06:34:52
It looks like a few people on stackoverflow get this to work but their code isn't posted. I'm using [web loadData:data MIMEType:MIMEType textEncodingName:@"UTF-8" baseURL:nil]; where MIMEType is: @"application/vnd.ms-powerpoint" @"application/vnd.ms-word" @"application/vnd.ms-excel" (BTW, I've seen DOC files use mimetype @"application/msword" but the "vnd" version seems more appropriate. I tried both just in case.) I verified that my 'data' is correct. PDF and TXT files work. When the UIWebView displays PPT, DOC, or XLS files, it's blank. I put NSLOG statements in my UIWebViewDelegate calls.

Facebook iOS Upload Video “Unable to retrieve session key from the access token.”

依然范特西╮ 提交于 2019-11-28 06:13:51
问题 I want to upload video on facebook using ios-sdk I check discussion in question iPhone Facebook Video Upload and try to implement it in my application I try to your code but not succeed I download your code https://github.com/zoul/facebook-ios-sdk take the FBVideoUpload.h/m classes from your src add add into my project include "FBVideoUpload.h" in FBConnect.h then I code for upload video as follow This is Code FBVideoUpload *upload = [[FBVideoUpload alloc] init]; upload.accessToken =

Having a UITabBar AND a UINavigationController in an app?

青春壹個敷衍的年華 提交于 2019-11-28 06:06:26
Hey everyone, I am new to iPhone development and I'm not understanding the whole UINavigationController and UITabBarController idea. Is one a substitute for the other - how do apps such as Tweetie combine both? I'd like to have my app have a persistent Tab Bar @ the bottom (which seems to be working), but also a Navigation bar at the top which can push/pop views onto the screen without removing the tab bar. How can I accomplish this? What should the hierarchy look like in IB as far as my MainWindow.xib with regards to all of these controllers? What is best practice here? Thanks very much,

Clear UIWebView content upon dismissal of modal view (iPhone OS 3.0)

笑着哭i 提交于 2019-11-28 05:54:34
I currently have a UIWebView that is displayed within a modal view. It is basically a detail view that provides a view of a page when the user clicks a link. When the view is dismissed and then brought up again (when the user clicks another link), the previously-loaded content is still visible and the new content loads "on top" of the last content. This makes sense because the instance of the UIWebView persists between sessions and is only released when the memory is needed. However, I would like to completely clear the UIWebView when the modal view is dismissed so that 1) content is cleared