iOS开发及Xcode使用中遇到的一些报错汇总(持续更新)
一、Xcode工程使用CocoaPods管理第三方库时出现错误:
问题描述:
解决方法:
出现上述错误的原因一般是第三方库更新导致的,这时需要使用终端把该工程所引用到的所有第三方库进行更新
步骤:
1、打开终端,cd到当前工程的根目录,例:cd /Users/HO/Downloads/LZAlbum-master
2、然后输入pod install 回车,终端会自动检测改工程所应用到的库并且更新
注意:如果出现Updating local specs repositories,并且等了很久没有回应,代表命令pod install被墙了
改用:pod install --verbose --no-repo-update
3、这时终端执行更新库操作
4、最后打开工程,就可以正常运行了。
下面是我测试工程时敲入的命名和更新的响应,一并贴上:
Last login: Tue Feb 23 15:02:32 on ttys003
HO-2:~ HO$ cd /Users/HO/Downloads/LZAlbum-master
HO-2:LZAlbum-master HO$ pod install --verbose --no-repo-update
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods`: (``)
Using `ARCHS` setting to build architectures of target `Pods-LZAlbum`: (``)
Using `ARCHS` setting to build architectures of target `Pods-LZAlbumTests`:
(``)
Resolving dependencies of `Podfile`
Comparing resolved specification to the sandbox manifest
A AVOSCloud
A DateTools
A FXForms
A MBProgressHUD
A SDWebImage
A TTTAttributedLabel
Downloading dependencies
-> Installing AVOSCloud (3.1.6.2)
> Http download
$ /usr/bin/curl -f -L -o
/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/file.zip
https://download.leancloud.cn/sdk/iOS/release-v3.1.6.2/Static/AVOSCloud.framework.zip
--create-dirs
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 2 8086k 2 207k 0 0 216k 0 0:00:37 --:--:-- 0:00:37 216 12 8086k 12 1007k 0 0 514k 0 0:00:15 0:00:01 0:00:14 514 22 8086k 22 1823k 0 0 616k 0 0:00:13 0:00:02 0:00:11 616 32 8086k 32 2639k 0 0 666k 0 0:00:12 0:00:03 0:00:09 666 42 8086k 42 3455k 0 0 696k 0 0:00:11 0:00:04 0:00:07 696 52 8086k 52 4255k 0 0 714k 0 0:00:11 0:00:05 0:00:06 809 62 8086k 62 5071k 0 0 728k 0 0:00:11 0:00:06 0:00:05 812 72 8086k 72 5887k 0 0 739k 0 0:00:10 0:00:07 0:00:03 812 82 8086k 82 6703k 0 0 748k 0 0:00:10 0:00:08 0:00:02 812 93 8086k 93 7535k 0 0 756k 0 0:00:10 0:00:09 0:00:01 816 100 8086k 100 8086k 0 0 760k 0 0:00:10 0:00:10 --:--:-- 820k
$ /usr/bin/unzip
/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/file.zip
-d /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33
Archive: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/file.zip
creating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/
creating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVHTTPRequestOperation.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVLocationManager.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVAmazonS3Client.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVNetworkActivityIndicatorManager.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVGlobal.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVImageRequestOperation.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVXMLRequestOperation.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVHelpers.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AFNetworkingFix.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVURLConnectionOperation.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVNetworking.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVHTTPClient.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVJSONRequestOperation.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/PrivateHeaders/AVFileHTTPRequestOperation.h
creating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/_CodeSignature/
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/_CodeSignature/CodeSignature
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/_CodeSignature/CodeResources
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/_CodeSignature/CodeRequirements
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/_CodeSignature/CodeDirectory
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/AVOSCloud
creating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Modules/
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Modules/module.modulemap
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Info.plist
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/embedded.mobileprovision
creating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVPush.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVQuery.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVAnonymousUtils.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVSession.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVUser.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVSearchQuery.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVGeoPoint.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVMessage.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVAnalytics.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVOSCloud.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVCloudQueryResult.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVSearchSortBuilder.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVSubclassing.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVGroup.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVHistoryMessageQuery.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVObject+Subclass.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVFileQuery.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVConstants.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVStatus.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVFile.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVInstallation.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVCloud.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVObject.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVACL.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVRole.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVSignature.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVRelation.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVHistoryMessage.h
inflating: /var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1y8hs33/iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/AVLogger.h
> Running prepare command
$ /bin/bash -c set -e cp
iOS/release-v3.1.6.2/Static/AVOSCloud.framework/AVOSCloud libAVOSCloud.a cp
iOS/release-v3.1.6.2/Static/AVOSCloud.framework/Headers/* .
> Copying AVOSCloud from
`/Users/HO/Library/Caches/CocoaPods/Pods/Release/AVOSCloud/3.1.6.2-a3cd4` to
`Pods/AVOSCloud`
-> Installing DateTools (1.5.0)
> Git download
> Git download
$ /usr/bin/git clone https://github.com/MatthewYork/DateTools.git
/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-vks426
--single-branch --depth 1 --branch v1.5.0
Cloning into '/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-vks426'...
Note: checking out '77c4955d23094ebad6268579b94f90d8a4a953c7'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
> Copying DateTools from
`/Users/HO/Library/Caches/CocoaPods/Pods/Release/DateTools/1.5.0-b93a2` to
`Pods/DateTools`
-> Installing FXForms (1.2.13)
> Git download
> Git download
$ /usr/bin/git clone https://github.com/nicklockwood/FXForms.git
/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-48ov0z
--single-branch --depth 1 --branch 1.2.13
Cloning into '/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-48ov0z'...
Note: checking out '578f557b3067aee99b852335b75f181c18b54869'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
> Copying FXForms from
`/Users/HO/Library/Caches/CocoaPods/Pods/Release/FXForms/1.2.13-22d5c` to
`Pods/FXForms`
-> Installing MBProgressHUD (0.9.1)
> Git download
> Git download
$ /usr/bin/git clone https://github.com/matej/MBProgressHUD.git
/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1cwsfqh
--single-branch --depth 1 --branch 0.9.1
Cloning into '/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1cwsfqh'...
Note: checking out 'ac7a7a8c5e2339c8db93b310b349d9776a077932'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
> Copying MBProgressHUD from
`/Users/HO/Library/Caches/CocoaPods/Pods/Release/MBProgressHUD/0.9.1-c47f2` to
`Pods/MBProgressHUD`
-> Installing SDWebImage (3.7.2)
> Git download
> Git download
$ /usr/bin/git clone https://github.com/rs/SDWebImage.git
/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1apzoww
--single-branch --depth 1 --branch 3.7.2
Cloning into '/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1apzoww'...
Note: checking out 'd41bfaf8c85b6887a67ffaa8cb15f92c9ee8c5ba'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
> Copying SDWebImage from
`/Users/HO/Library/Caches/CocoaPods/Pods/Release/SDWebImage/3.7.2-71b7c` to
`Pods/SDWebImage`
-> Installing TTTAttributedLabel (1.13.4)
> Git download
> Git download
$ /usr/bin/git clone
https://github.com/TTTAttributedLabel/TTTAttributedLabel.git
/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1dhpbkr
--single-branch --depth 1 --branch 1.13.4
Cloning into '/var/folders/pm/tss1ybz54hqfwyjr83df84r40000gn/T/d20160223-2036-1dhpbkr'...
Note: checking out '6d66966f7c1f58b7afc02ee54b828ba2a142ce46'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
> Copying TTTAttributedLabel from
`/Users/HO/Library/Caches/CocoaPods/Pods/Release/TTTAttributedLabel/1.13.4-0a2ac`
to `Pods/TTTAttributedLabel`
- Running pre install hooks
Generating Pods project
- Creating Pods project
- Adding source files to Pods project
- Adding frameworks to Pods project
- Adding libraries to Pods project
- Adding resources to Pods project
- Linking headers
- Installing targets
- Installing target `DateTools` iOS 7.0
- Installing target `FXForms` iOS 7.0
- Installing target `MBProgressHUD` iOS 7.0
- Installing target `SDWebImage` iOS 7.0
- Installing target `TTTAttributedLabel` iOS 7.0
- Installing target `Pods-LZAlbum` iOS 7.0
- Installing target `Pods-LZAlbumTests` iOS 7.0
- Running post install hooks
- Writing Xcode project file to `Pods/Pods.xcodeproj`
- Generating deterministic UUIDs
- Writing Lockfile in `Podfile.lock`
- Writing Manifest in `Pods/Manifest.lock`
Integrating client project
Integrating target `Pods-LZAlbum` (`LZAlbum.xcodeproj` project)
Integrating target `Pods-LZAlbumTests` (`LZAlbum.xcodeproj` project)
- Running post install hooks
- cocoapods-stats from
`/Library/Ruby/Gems/2.0.0/gems/cocoapods-stats-0.6.2/lib/cocoapods_plugin.rb`
Sending stats
- AVOSCloud, 3.1.6.2
- DateTools, 1.5.0
- FXForms, 1.2.13
- MBProgressHUD, 0.9.1
- SDWebImage, 3.7.2
- TTTAttributedLabel, 1.13.4
Pod installation complete! There are 6 dependencies from the Podfile and 6
total pods installed.
HO-2:LZAlbum-master HO$
5、当然,我在网上看到有有些人在一些情况下通过上面4个步骤之后,还会出现以下错误(本人没有遇到过)
/Users/wmm-mac/Documents/Program-SVN/Versions/code/iPhone/GeneralProject/Pods/Pods-resources.sh: line 5: /Users/wmm-mac/Documents/Program-SVN/Versions/code/iPhone/GeneralProject/Pods/resources-to-copy-GeneralProject.txt: Permission denied
那是因为Pod没有权限:
这时我们执行下面代码即可:
sudo chmod 777 Pods
二、在使用Xcode进行开发时,我们有时会碰到程序正常运行,编译成功,但模拟器却始终没有反应。
问题描述:一般出现这种情况的原因是我们编译的是静态库,这时我们检查一下当前的scheme是什么。Product -> Scheme 选择正确的动态库运行即可。
三、bitcode错误
报错
以上问题需要导入::CoreTelephony.framework
Undefined symbols for architecture x86_64:
"operator delete[](void*)", referenced from:
+[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
+[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
+[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
+[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
"operator new[](unsigned long)", referenced from:
+[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
+[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
+[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
+[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这个需要导入 libc++.tbd (xcode里面)
报错类似:
2015-12-09 15:58:03.062 Carloans[14328:2300485] Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7fe5ac728b50> { URL: http://api.lizicaifu.com/api.php?s=/Member/index.html&token=e0e9162086738e15a066daed1ff94baa&user_token=c8d353b0008099ba72fbcfea0b16f1c3 } { status code: 200, headers {
"Cache-Control" = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Type" = "text/html";
Date = "Wed, 09 Dec 2015 07:57:58 GMT";
Expires = "Thu, 19 Nov 1981 08:52:00 GMT";
Pragma = "no-cache";
Server = nginx;
"Transfer-Encoding" = Identity;
"X-Powered-By" = "PHP/5.5.29";
} }, NSErrorFailingURLKey=http://api.lizicaifu.com/api.php?s=/Member/index.html&token=e0e9162086738e15a066daed1ff94baa&user_token=c8d353b0008099ba72fbcfea0b16f1c3, com.alamofire.serialization.response.error.data=<7b227374 61747573 223a2d33 2c22696e 666f223a 225c7538 6266375c 75393163 645c7536 3562305c 75373637 625c7535 66353522 2c226669 72737422 3a6e756c 6c2c226c 61737422 3a224144 38444444 45322d41 4642312d 34343130 2d423536 452d3634 46434331 32303241 4134227d>, NSLocalizedDescription=Request failed: unacceptable content-type: text/html}
1.修改内部文件
AFURLResponseSerialization.m 这个文件找到这句话self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil]; 然后把 text/html 加进去就可以了! 试试,我就是这么干的。
2.在外面修改
2.0已经对各种方法做了优化,也不需要用AFJSONRequestOperation,2.0已经自带JSON解析。
你可以用AFHTTPRequestOperationManager解决一切问题,遇到你的这个问题,你可以像这么写:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];//设置相应内容类型
[manager POST:url parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
2.0会对返回的JSON或者XML自动解析为字典的