我有一个UITableView,我是showng数据indexPath.section,但是,当我快速滚动我的表视图时,它的数据保持重叠.如何解决这个问题?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
switch(indexPath.section)
{
// case 0 to 10;
//values change if I scroll my table
}
Run Code Online (Sandbox Code Playgroud)
}
我正在使用本地通知,但我想在警报的邮件正文中放置一个图像.我怎样才能做到这一点?
我正在使用一些Objective-c代码进行服务器调用.如果它返回为a @"yes",它将执行操作.由于某种原因,// DO ACTION HERE从未达到过该部分.
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
NSString *returnStringResults = returnString;
NSString *yesText = @"yes";
if (returnStringResults == yesText) {
testLabel.text = @"Success";
// DO ACTION HERE
}
Run Code Online (Sandbox Code Playgroud) 我想在应用程序安装和第一次打开时在视图控制器上显示帮助消息.
有没有一种方法可以用来做到这一点?
我正在写一个查询,但它总是说"找不到匹配的索引".我不知道为什么.我的代码如下:
Query query = pm.newQuery(Classified.class);
query.setFilter("emp_Id == emp");
query.setOrdering("upload_date desc");
query.declareParameters("String emp");
List<Classified> results = (List<Classified>)query.execute(session.getAttribute("emp_Id").toString());
Run Code Online (Sandbox Code Playgroud)
<?xml version="1.0" encoding="utf-8"?>
<datastore-indexes autoGenerate="true">
<datastore-index kind="Classified" ancestor="false">
<property name="emp_Id" direction="asc" />
<property name="category" direction="asc" />
<property name="upload_date" direction="desc" />
</datastore-index>
</datastore-indexes>
Run Code Online (Sandbox Code Playgroud)
我已经添加了上面的索引,但它没有帮助.
我只是想知道:如果将对象的保留计数添加到Objective-C中的数组或字典中,它是否会增加?将数据添加到数组或字典后,我可以立即释放它吗?
我创建了一个可变数组,我有两个NSString变量.现在我想将这两个NSStrings 添加到我的数组中.这怎么可能?谢谢.
如何获得特定应用程序NSMutableDictionary或NSMutableArray特定应用程序的内存大小?
我有一个变量声明为NSDictionary.如何将其复制到extern const NSArray变量?例如:
NSMutableDictionary *selectedItem = [self.dataArray objectAtIndex:indexPath.row];
[selectedItem setObject:[NSNumber numberWithBool:targetCustomCell.checked]
forKey:@"checked"];
Run Code Online (Sandbox Code Playgroud) 我想知道如何比较一个字符串和一个数组,即,如果我的数组列表已经{"abc", "pqr", "xyz"}和新字符串让我们说"mno"是键入,它应该与我以前的数组列表进行比较.我怎样才能做到这一点?提前致谢.
ios ×6
objective-c ×6
cocoa-touch ×3
cocoa ×2
nsarray ×2
nsdictionary ×2
nsstring ×2
arrays ×1
iphone ×1
java ×1
jdo ×1
memory ×1
retaincount ×1
scroll ×1
uitableview ×1