我收到此错误.我不知道为什么要调用它,谷歌并没有真正帮助.有什么建议?
-[UIWindow endDisablingInterfaceAutorotation] called on <UIWindow: 0x4e0ec50; frame = (0 0; 320 480); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x4e0f9e0>> without matching -beginDisablingInterfaceAutorotation. Ignoring.
Run Code Online (Sandbox Code Playgroud) 我有一个使用分组样式的TableViewController,有两(2)个部分.第一部分有4行,第二部分有3行.我在每个单元格中放置了一个UILabel和一个UITextField,并且有一个自定义方法(textFieldDone :)来处理按下返回键时光标移动到下一个文本字段.
如果只有一个部分,这工作正常和花花公子,但我有两个:(是的,我需要两个:)
所以我开始编写一个答案,但得到的结果只是不起作用,我在调试期间注意到单元格标识符(我使用两个)只显示一个(在调试控制台中)并且它只是第一个(通用细胞).
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = nil;
switch (indexPath.section)
{
case AUTO_DETAILS:
{
static NSString *cellID = @"GenericCell";
cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2
reuseIdentifier:cellID] autorelease];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 75, 25)];
label.tag = kLabelTag;
label.font = [UIFont boldSystemFontOfSize:14];
label.textAlignment = UITextAlignmentRight;
[cell.contentView addSubview:label];
[label release];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(90, 12, 200, 25)];
textField.clearsOnBeginEditing = NO;
[textField setDelegate:self];
[textField …Run Code Online (Sandbox Code Playgroud) 我有一个UILabel有一个格式化的字符串(格式化为货币),所以有一个美元符号,$ 21.34.
在核心数据实体中,属性是double类型,我使用NSDecimalNumber来保存到数据库.
self.purchase.name = self.nameTextField.text;
NSString *string = self.amountLabel.text
NSDecimalNumber *newAmount = [[NSDecimalNumber alloc] initWithString:string];
NSLog(@"%@", string); // THIS RETURNS NaN, because of dollar sign i think
NSManagedObjectContext *context = self.purchase.managedObjectContext;
NSError *error = nil;
if (![context save:&error])
{
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
Run Code Online (Sandbox Code Playgroud)
无论如何,我需要这不是NaN,所以我的想法是删除美元符号,但我不知道该怎么做,或者也许有更好的方法来实现我的目标.
iphone ×3
objective-c ×2
cursor ×1
formatting ×1
keyboard ×1
return ×1
textfield ×1
uikit ×1
uiwindow ×1