我刚做了最后一次Xcode更新(8.3),我收到了消息:
对于使用Swift的目标,需要正确配置"Swift语言版本"(SWIFT_VERSION).使用[Edit> Convert> To Current Swift Syntax ...]菜单选择Swift版本或使用Build Settings编辑器直接配置构建设置.
知道刚刚从构建设置中删除了"使用Legacy Swift语言版本"选项,如何在不进行任何转换的情况下在Swift 2.3中生成我的应用程序?
我尝试编写一个类来管理 SQLite 数据库,但出现错误消息“需要顶级声明 > 任务 :app:buildInfoGeneratorDebug”。
package com.xexxxwxxxxs.GMP
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import android.content.Context
import android.content.ContentValues
class DBHandler(context: Context, name: String?, factory: SQLiteDatabase.CursorFactory?, version: Int) : SQLiteOpenHelper(context, DATABASE_NAME, factory, DATABASE_VERSION)
{
override fun onCreate(db: SQLiteDatabase)
{
}
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int)
{
}
companion object
{
private val DATABASE_VERSION = 1
private val DATABASE_NAME = "GMP.db"
}
}?
Run Code Online (Sandbox Code Playgroud)
你有什么想法?
提前致谢
当我使用以下代码时,我有错误消息:
[NSURLConnection sendAsynchronousRequest:request queue:myQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"response status code: %ld, error status : %@", (long)[httpResponse statusCode], error.description);
if ((long)[httpResponse statusCode] >= 200 && (long)[httpResponse statusCode]< 400)
{
// do stuff
[self requestFunction]; //Web Service
}
}];
Run Code Online (Sandbox Code Playgroud)
错误消息:
2017-02-27 01:13:30.088641 RENAULT[210:12313] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-02-27 01:13:30.090449 RENAULT[210:12313] [MC] Reading from public effective user settings.
Run Code Online (Sandbox Code Playgroud)
[self requestFunction]函数启动一个简单的请求:
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] init];
NSString *url_string …Run Code Online (Sandbox Code Playgroud) xcode objective-c nsurlconnection ios sendasynchronousrequest
我显示的弹出窗口现在显示不正确。箭头一侧缺少一条线。我们可以检查箭头的末端是否有一块黑色。我认为里面的视图太长了。
显示弹出窗口的代码:
_popoverController = UIPopoverController(contentViewController: navController)
_popoverController?.delegate = self
let rect = slotCollectionView.cellForItem(at: indexPath)!.frame
self._popoverController?.backgroundColor = UIColor.init(rgb: Int(quaternaryColorHexa))
self._popoverController?.present (from: rect, in: self.slotCollectionView, permittedArrowDirections: UIPopoverArrowDirection.any, animated: true)
Run Code Online (Sandbox Code Playgroud)
初始化Popover的代码:
override func viewDidLoad()
{
super.viewDidLoad()
self.preferredContentSize = contentSize()
self.navigationController!.preferredContentSize = self.preferredContentSize;
peopleTableView.isScrollEnabled = true
peopleTableView.bounces = true
peopleTableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
peopleTableView.tableFooterView?.isHidden = true
peopleTableView.backgroundColor = UIColor.init(rgb: Int(quinquenaryColorHexa))
self.view.backgroundColor = UIColor.init(rgb: Int(quinquenaryColorHexa))
self.view.layer.cornerRadius = 13.0
self.view.layer.borderWidth = 1.5
self.view.layer.borderColor = UIColor.init(rgb: Int(quaternaryColorHexa)).cgColor
Run Code Online (Sandbox Code Playgroud)
我的 TableView 的标题在 iOS13 中显示不佳。不管我放什么颜色,它现在总是显示浅灰色......
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{ //Section color & style
UITableViewHeaderFooterView *v = (UITableViewHeaderFooterView *)view;
v.backgroundView.alpha = 1;
v.textLabel.textColor = sectionColor;
v.textLabel.font = sectionFont;
v.textLabel.numberOfLines = 1;
v.textLabel.minimumScaleFactor = 0.5;
v.textLabel.adjustsFontSizeToFitWidth = YES;
v.backgroundView.backgroundColor = [UIColor blueColor];
}
Run Code Online (Sandbox Code Playgroud)
这很奇怪,因为当我逐步停止调试器时,它在iOS13中向我显示了良好的图像,但在应用程序中却没有:
当我在TextView中快速点击进入TableView时,我收到一条错误消息.它崩溃并给我错误信息:
*** Assertion failure in -[_UIKBRTRecognizer notifyDelegateOfCancelledTouch:],
/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3600.5.2/Keyboard/_UIKBRTRecognizer.m:996
2017-01-14 18:17:18.558043 Formbox_Dacia_BE_Bruxelles_2017[317:15523]
*** Assertion failure in -[_UIKBRTRecognizer notifyDelegateOfCancelledTouch:], /BuildRoot/Library/
Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Can't cancel on a touch that isn't already active!'
*** First throw call stack:
(0x1e00ae07 0x1d26b077 0x1e00ace1 0x1e8de0f1 0x236fbeb3 0x236fa3f1 0x3f6d67 0x402ed9 0x3fa215 0x404de1 0x404be9 0x1d866937 0x1d86648c)
libc++abi.dylib: terminating with uncaught exception of type
NSException
Run Code Online (Sandbox Code Playgroud)
有任何想法吗 ?
编辑:似乎是当我点击键盘选择时,我按下键盘触摸信息.
我有一个脚本可以升级我的版本(0.01 by 0.01)和我的版本(1 by 1)。它不再适用于 Xcode 11。
这是我的脚本:
#!/bin/bash
rm -rf build
Version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE")
Version=$(echo "scale=2; $Version + 0.01" | bc)
Build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
Build=$($Build + 1)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $Build"
"$INFOPLIST_FILE"
if [ "${CONFIGURATION}" = "Release" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $Version" "$INFOPLIST_FILE"
fi
Run Code Online (Sandbox Code Playgroud)
这是当我想在 Xcode 中构建或存档时出现的错误消息:
细节
无法安装请求的应用程序
域:NSPOSIXErrorDomain 代码:22
失败原因:应用程序的 Info.plist 不包含 CFBundleShortVersionString。
恢复建议:确保您的捆绑包包含 CFBundleShortVersionString。
用户信息:{
bundleURL =“file:///Users/olosta/Library/Developer/Xcode/DerivedData/Formbox-cxaxehrhmxqaqabbijmxvasgmhwn/Build/Products/Debug-iphonesimulator/Formbox_Renault_BusinessDays.app/”;
}
我检查了那张票,但它对我的脚本没有帮助
如果我进入 Xcode/General/Identity,我可以看到 Xcode 中填写了“版本”和“构建”,
但如果我通过手动打开 info.plist 来检查它,两个值都是空的
<key>CFBundleVersion</key> …Run Code Online (Sandbox Code Playgroud) 我想选择并滚动到一个特定indexPath的collectionView中心.我找到了这些功能,但不可能将它们组合起来:
collectionView.selectItem(at: indexPath, animated: true, scrollPosition: UICollectionViewScrollPosition.centeredVertically)
collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
collectionView.scrollToItem(at: indexPath, at: .centeredVertically, animated: true)
Run Code Online (Sandbox Code Playgroud)
提前致谢.
我没有成功使用iOS中的Twitter API连接与Objective-C.我用那些代码:
[[Twitter sharedInstance] logInWithCompletion:^
(TWTRSession *session, NSError *error) {
if (session) {
NSLog(@"");
}}];
Run Code Online (Sandbox Code Playgroud)
在我的AppDelegate中:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Twitter
[[Twitter sharedInstance] startWithConsumerKey:@"z0F**************cg" consumerSecret:@"PJu*******************N6W"];
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
return [[Twitter sharedInstance] application:app openURL:url options:options];
return NO;
}
Run Code Online (Sandbox Code Playgroud)
我确切地说,openURL永远不会被调用.
我收到了一些我不明白的错误消息:
Error Domain=TWTRNetworkingErrorDomain Code=-1011 "Request failed: unauthorized (401)" UserInfo={NSLocalizedFailureReason=Twitter API error : <?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
(code (null)), TWTRNetworkingStatusCode=401, NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSLocalizedDescription=Request failed: unauthorized (401)} …Run Code Online (Sandbox Code Playgroud) 在Xcode中,我想轻松地将所有文件扩展名从PNG重命名为JPG。我尝试查找并替换,但它仅更改情节提要,类等中的名称,而不更改文件名。
如果我仅以物理方式更改名称,则文件很多:
ios ×9
xcode ×5
objective-c ×4
swift ×3
swift3 ×2
uitableview ×2
android ×1
ios13 ×1
kotlin ×1
rename ×1
run-script ×1
sqlite ×1
swift2 ×1
target ×1
twitter ×1
uitextview ×1
versioning ×1