Tag: ios4

如何知道UITextView何时成为第一响应者

当uitextview成为第一响应者时如何处理。 我有文本视图中的文本,并希望视图变为活动时要清除文本。 我怎样才能做到这一点? 提前致谢

重用细胞… :(

我有一个9节56行的桌子。 我想为每个单元添加一个文本标签。 我创build了一个包含56个NSDictionaries的NSArray menuList和一个包含每个节( menuList的行数的数组。 这里是我的代码,但它不能正常工作: // Customize the appearance of table view cells. – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //Use existing cell (reusable) UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier]; //If no existing cell, create a new one if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellIdentifier] autorelease]; //Define cell accessory type cell.accessoryType […]

图表API和iOS

如何在iOS编程(目标C)中使用/实现新的Graph API? 还parsingAPI返回的JSON文件? 我似乎无法find任何例子。 Facebook的资源并没有提供太多关于iOS开发的细节。

如何在我的iPhone应用程序中支持iOS 4.X SDK和iOS 5 SDK?

我正在编写一个iPhone应用程序,我希望在这个时间点支持最大的用户群(尽可能less的痛苦),所以我决定将IOS 4.3+作为目标用户的一个好的子集。 我开始在XCode 4.2中工作,但是当我意识到项目模板已经改变,并且所有东西似乎都与故事板,ARC等交织在一起时,我又回到了XCode 4.1。 我已经build立了我的应用程序,我真的想在装有iOS5的设备上testing。 当我尝试使用它时,只要单击Organizer / XCode中的“用于开发”,就会收到此消息: 该项目的构build设置如下所示: 我的问题是这样的:我如何获得这个应用程序,内置在XCode 4.1,在iOS 4.3和iOS 5手机上运行? iOS SDK是不是向后兼容? 我来自Android开发,其中一个不到当前的SDK将通常工作在一个新的SDK – 在iOS世界这是不同的? 如果是这样,通常如何处理? 任何方向我应该如何进行将不胜感激。

在同一个iOS设备上的不同应用之间共享数据

是否可以在同一设备上的两个应用程序之间共享任何types的数据,而不必依靠外部服务和/或udids?

如何在不连接到AddressBook的情况下使用ABPersonViewController

安装程序:我正在寻找使用ABPersonViewContoller而不从AddressBook获取数据的见解。 我有一个JSON Web服务喂食一个tableview,我有我的个人对象存储在一个mutableArray作为字典。 我的问题:我一直在search,无法find任何引用与您自己的对象使用personViewController。 我可以启动一个新的人物分配给我的人物,并推动控制器? 或者我会更好地滚动我自己的观点来复制苹果吗? 更新:正如埃里克build议使用ABRecordRef作为我的对象,它实际上工作。 这里是一个代码示例。 // get index and set person object int personIndex = [indexPath indexAtPosition: [indexPath length] – 1]; ABRecordRef person = ABPersonCreate(); ABRecordSetValue(person, kABPersonFirstNameProperty, [[personList objectAtIndex: personIndex] objectForKey: @"firstName"], nil); ABRecordSetValue(person, kABPersonLastNameProperty, [[personList objectAtIndex:personIndex] objectForKey:@"lastName"], nil); // initialize a personviewController ABPersonViewController *personViewController = [[ABPersonViewController alloc] init]; personViewController.personViewDelegate = self; […]

UI自动化testing:如何selectUIAPickerWheel值?

我试图为我的iPhone应用程序编写一些自动化testing时遇到了障碍。 从文档判断,我觉得这应该select我的UIPickerView的第一个组件的第一行: var picker = UIATarget.localTarget().frontMostApp().mainWindow().pickers()[0]; var aWheel = picker.wheels()[0]; var someVals = aWheel.values(); aWheel.selectValue(someVals[0]); 但相反,我得到以下错误,login仪器: Exception raised while running script: – selectValue requires a valid value 任何想法,我可以 在我的UIPickerView单元/组件上设置可预测的值? 目前,他们都使用自定义的UIViews,而不是标准的标签。 要么 以某种方式从我现有的单元格获取一个值的数组遍历? 我在这里错过了什么?

TableView与2列,iphone / ipad

任何人都可以告诉我如何在Iphone SDK中由colums创build两个单元格的tableview? 在这样的命令: _____________ | 1 | 2 | |_____|______| | 3 | 4 | |_____|______| 最好的祝福

TBXML将复杂的xmlparsing到数组中

我有一个XML响应,我需要设置到一个数组。 问题是我需要访问每个元素,并将其存储在一个数组中,以便我可以将其用于tableview。 <?xml version="1.0" encoding="UTF-8"?> <Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.2sms.com/2.0/schema/0310_ResponseReportStandard.xsd" Version="1.0"> <Error> <ErrorCode>00</ErrorCode> <ErrorReason>OK</ErrorReason> </Error> <ResponseData> <Identification> <UserID>jonathan.pink@2sms.com</UserID> </Identification> <Result>2 records were returned</Result> <Detail> <ReportTitle>Message Summary: Today</ReportTitle> <Record> <Destination>447790686158</Destination> <Status>WithNetwork</Status> <GUID><![CDATA[2011-03-22T10:54:22.097Z]]></GUID> <DateSubmitted>2011-03-22T10:54:22.097</DateSubmitted> <DateToSend></DateToSend> <DateSent>2011-03-22T10:54:22.533</DateSent> <DateReceived></DateReceived> <Message><![CDATA[Yet again another test]]></Message> <ID>2011-03-22 10:54:22.250HIHIIOJTFVETW85TS</ID> </Record> <Record> <Destination>447790686158</Destination> <Status>SUCCESS</Status> <GUID><![CDATA[2011-03-22T10:50:40.064Z]]></GUID> <DateSubmitted>2011-03-22T10:50:40.063</DateSubmitted> <DateToSend></DateToSend> <DateSent>2011-03-22T10:50:42.473</DateSent> <DateReceived>2011-03-22T10:50:54.570</DateReceived> <Message><![CDATA[This is a test]]></Message> <ID>2011-03-22 10:50:40.210DRUDVMCEZGETW85TS</ID> </Record> […]

如何在iPhone上实现一个酷警报/信息覆盖?

我知道如何在我的iPhone应用程序中包含一个标准警报,并可以通过OK或CLOSEbutton来解除它(请参阅图像中的Epicurious示例)。 我怎样才能做出像在foursquare应用程序中看到的一个很酷的警报/通知覆盖(见图中的四方形示例)? 特别是如何在graphics中包含警报/通知布局。 这是一个单独的观点? 如果你能指点我的教程或示例代码,这将使我朝着正确的方向前进, 非常感谢! 🙂