我有UIWebView动态设置高度的问题.webview加载包含html的产品说明.我希望UIWebView根据描述的内容改变它的高度.父滚动视图也应该改变它的高度,但是然后根据高度UIWebView.
任何人都可以向我解释如何实现我的观点所需的行为吗?
这是我的视图层次结构:

我有Mac和iPhone应用程序的.app文件,但未安装Xcode。如何在没有Xcode的iPhone上安装应用程序?
我创建了UIPickerView4个组件.
我可以为其中的每个组件添加标题标题UIPickerView吗?
谢谢你的建议
我无法为模拟器编译我的项目.
我得到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) 我有一个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) 我需要使用日期时间和当前位置纬度和经度来计算Nakshatra和Thithi.
来自的日期
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.有人可以详细说明数学计算吗?
在我们的故事板中,我们有多个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.rootViewController为UINavigationControllerApp 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堆栈并使用新堆栈?或者也许我不应该在我的应用代理中调用此代码?
UIDatePicker当我将日历设置为NSIslamicCalendar或NSIslamicCivilCalendar喜欢这样时,会出现一个奇怪的问题:
picker.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCalendar];
Run Code Online (Sandbox Code Playgroud)
并尝试选择随机年份的第一天或最后一天,我注意到当前所选年份是重复的,并且第一天的第二天出现在第一天之前,如下面的屏幕截图所示:

where Muharram是第一个月Dhu'l-Hijjah的名称,是伊斯兰日历的最后一个月的名称.
这是一个错误,UIDatePicker或者我应该做一些解决方法来摆脱这个小故障?
ps这在iOS 6和7模拟器中被注意到,并且除了日历属性之外,没有为选择器设置其他属性.
我正在尝试使用以下代码行将大文件上传到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) 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?
ios ×10
iphone ×5
objective-c ×4
.app ×1
icloud ×1
ipad ×1
storyboard ×1
uidatepicker ×1
uipickerview ×1
uitableview ×1
uiwebview ×1
xcode ×1