小编Ama*_*mar的帖子

具有自动布局的UIWebView的动态高度

我有UIWebView动态设置高度的问题.webview加载包含html的产品说明.我希望UIWebView根据描述的内容改变它的高度.父滚动视图也应该改变它的高度,但是然后根据高度UIWebView.

任何人都可以向我解释如何实现我的观点所需的行为吗?

这是我的视图层次结构:

在此输入图像描述

iphone objective-c uiwebview ios

7
推荐指数
3
解决办法
1万
查看次数

如何在iOS设备上运行.app

我有Mac和iPhone应用程序的.app文件,但未安装Xcode。如何在没有Xcode的iPhone上安装应用程序?

iphone .app ios

7
推荐指数
2
解决办法
1万
查看次数

将标头添加到UIPickerView

我创建了UIPickerView4个组件.
我可以为其中的每个组件添加标题标题UIPickerView吗?

谢谢你的建议

uipickerview ios

6
推荐指数
3
解决办法
1万
查看次数

如何解决ios7和Xcode 5.0.1中的Mach-O-Linker错误

我无法为模拟器编译我的项目.
我得到Apple Mach-O-Linker错误.我无法理解如何解决问题.我使用的是xcode 5.0.1.
请帮我任何身体.
提前致谢.

Ld /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator/ClassifiedDetails.app/ClassifiedDetails normal i386
    cd /Users/murthych/Desktop/ClassifiedDetails
    setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator -F/Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Intermediates/ClassifiedDetails.build/Debug-iphonesimulator/ClassifiedDetails.build/Objects-normal/i386/ClassifiedDetails.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework XCTest -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Intermediates/ClassifiedDetails.build/Debug-iphonesimulator/ClassifiedDetails.build/Objects-normal/i386/ClassifiedDetails_dependency_info.dat -o /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator/ClassifiedDetails.app/ClassifiedDetails
Run Code Online (Sandbox Code Playgroud)

Mach-O-Linker错误消息

building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/??XCTest' for architecture i386 clang: error: linker command failed with exit code 1 (use -v to …
Run Code Online (Sandbox Code Playgroud)

iphone xcode ios

6
推荐指数
1
解决办法
2万
查看次数

如何在单击按钮上获取UITableviewcell(自定义单元格)值

我有一个UITableViewCell(自定义单元格),我在其中创建一些按钮和文本字段,并为按钮和文本字段分配标签.但是我无法在点击按钮上获得按钮标题和文本字段值.

cellForRowAtIndexPath

`[((CustomCell *) cell).btn setTag:rowTag];
 [((CustomCell *) cell).textField2 setTag:rowTag+1];`

-(IBAction)submitBtnAction:(UIControl *)sender
{
    for (int i=0; i<[self->_dataArray count]; i++)
    {
        NSIndexPath *myIP = [NSIndexPath indexPathForRow:i inSection:0];
        NSLog(@"myIP.row %d",myIP.row);
        UITableViewCell *cell = [tblView1 cellForRowAtIndexPath:myIP];
        NSLog(@"tag %d",cell.tag);
        UIButton *btn = (UIButton *)[cell.contentView viewWithTag:i];
        NSLog(@"btn text %@, tag %d",btn.titleLabel.text,btn.tag);
        UITextField *tf = (UITextField *)[cell.contentView viewWithTag:i+1];
        NSLog(@"tf text %@, tag %d",tf.text,btn.tag);

    }
}
Run Code Online (Sandbox Code Playgroud)

我收到这样的错误

-[UITableViewCellContentView titleLabel]: unrecognized selector sent to instance 0x71844e0
2013-07-17 13:48:29.998 Text[1271:c07] *** Terminating app due to uncaught …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

5
推荐指数
1
解决办法
1万
查看次数

如何使用日期查找Nakshatra和thithi

我需要使用日期时间和当前位置纬度和经度来计算NakshatraThithi.

来自的日期

    NSDate *today = [NSDate date];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
 // display in 12HR/24HR (i.e. 11:25PM or 23:25) format according to User Settings
    [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
    NSString *currentTime = [dateFormatter stringFromDate:today];
    [dateFormatter release];
Run Code Online (Sandbox Code Playgroud)

经度和纬度值来自NSLocationManager.有人可以详细说明数学计算吗?

objective-c ipad ios

5
推荐指数
1
解决办法
1346
查看次数

在Storyboard中切换UINavigationController堆栈的最佳实践

在我们的故事板中,我们有多个UINavigationController堆栈.例如,LoginViewController堆栈与堆栈完全分离SWRevealViewController.

切换它们的最佳做法是什么?当我按下注销按钮(注销按钮在SWRevealController堆栈上)然后尝试呈现LoginViewController堆栈时,我收到如下错误:

Warning: Attempt to present LoginViewController on SWRevealViewController whose view is not in the window hierarchy!
Run Code Online (Sandbox Code Playgroud)

即使我专门设置self.window.rootViewControllerUINavigationControllerApp Delegate中的Login View Controller ,如下所示:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Spitfire" bundle:nil];
UINavigationController *nav = [storyboard instantiateViewControllerWithIdentifier:@"LoginNavigationController"];
LoginViewController *loginVC = [storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];

self.window.rootViewController = nav;
[nav presentViewController:loginVC animated:NO completion:nil];    
Run Code Online (Sandbox Code Playgroud)

有没有办法可以"解雇"当前的UINavigationController堆栈并使用新堆栈?或者也许我不应该在我的应用代理中调用此代码?

storyboard uinavigationcontroller ios

5
推荐指数
1
解决办法
3694
查看次数

UIDatePicker中重复的年份和天数

UIDatePicker当我将日历设置为NSIslamicCalendarNSIslamicCivilCalendar喜欢这样时,会出现一个奇怪的问题:

picker.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCalendar];
Run Code Online (Sandbox Code Playgroud)

并尝试选择随机年份的第一天或最后一天,我注意到当前所选年份是重复的,并且第一天的第二天出现在第一天之前,如下面的屏幕截图所示:

在此输入图像描述

where Muharram是第一个月Dhu'l-Hijjah的名称,是伊斯兰日历的最后一个月的名称.

这是一个错误,UIDatePicker或者我应该做一些解决方法来摆脱这个小故障?

ps这在iOS 6和7模拟器中被注意到,并且除了日历属性之外,没有为选择器设置其他属性.

uidatepicker ios

5
推荐指数
1
解决办法
319
查看次数

Cocoa错误262,无法将文件上传到iCloud

我正在尝试使用以下代码行将大文件上传到iCloud:

-(void)uploadFileWithFilePath:(NSString *)Path toFileURLInCloud:(NSURL *)destURL{
    NSURL * filePath = [NSURL URLWithString:Path];
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void)
    {
        NSFileCoordinator* fileCoordinator = [[NSFileCoordinator alloc] initWithFilePresenter:nil];
        [fileCoordinator coordinateReadingItemAtURL:filePath
                            options:NSFileCoordinatorReadingWithoutChanges
                              error:nil
                         byAccessor:^(NSURL *newURL)
        {
            NSFileManager * fileManager = [[NSFileManager alloc] init];
            NSError * error;
            BOOL success = [fileManager copyItemAtURL:filePath toURL:destURL error:&error];
            if (success) {
                NSLog(@"Copied %@ to %@", filePath, destURL);
            }
            else {
                NSLog(@"Failed to copy %@ to %@: %@", filePath, destURL, error.localizedDescription);
            }
        }];
    });
}
Run Code Online (Sandbox Code Playgroud)

我收到这个错误

The operation couldn’t be completed. (Cocoa error 262.) …
Run Code Online (Sandbox Code Playgroud)

iphone ios icloud

4
推荐指数
1
解决办法
2332
查看次数

在UIView中绘制垂直线

UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(0, dialogContainer.bounds.size.height - buttonHeight - buttonSpacerHeight, dialogContainer.bounds.size.width, buttonSpacerHeight)];
lineView.backgroundColor = [UIColor colorWithRed:198.0/255.0 green:198.0/255.0 blue:198.0/255.0 alpha:1.0f];
[dialogContainer addSubview:lineView];
Run Code Online (Sandbox Code Playgroud)

我已经使用此代码在UIView上绘制水平线.如何将垂直线添加到UIView?

iphone objective-c ios

4
推荐指数
1
解决办法
7465
查看次数