小编Spe*_*kim的帖子

不总是调用OnSerializing/OnSerialized方法

这是我在项目中序列化的结构:

[Serializable]
class A : List<B> //root object being serialized

[Serializable]
class B
  + [A few serializable fields]
  + C customList

[Serializable]
class C : List<D>

[Serializable]
class D
  + [several serializable fields]
  |
  + [NonSerialized] nonserializable3rdPartyClass data
  + string xmlOf3rdPartyData
  |
  + [OnSerializing]
  + private void OnSerializing(StreamingContext context)
  |
  + [OnSerialized]
  + private void OnSerialized(StreamingContext context)
  |
  + [OnDeserialized]
  + private void OnDeserialized(StreamingContext context)
Run Code Online (Sandbox Code Playgroud)

nonserializable3rdPartyClass,虽然没有标记为[Serializable]提供.ToXml.FromXml我在我的使用方法.OnSerializing.OnDeserialized方法,分别存储和检索XML字符串xmlof3rdPartyData. …

c# serialization binaryformatter

9
推荐指数
1
解决办法
4468
查看次数

使用从属子项目时在Xcode中链接问题

我正在使用Xcode编写一个iPhone项目,并使用外部库.我将Xcode项目文件添加到父目标并调整标头搜索路径并将其设置为父目标构建目标中的直接依赖项.

现在奇怪的事情发生了:我可以打开库并编译它没有问题.该库链接到一些框架,例如AVFoundation.framework.

我清理目标并开始构建父项目.在我的构建结果中,我看到它构建了库,但随后链接失败并显示以下错误消息:

Undefined symbols:
  "_AVCaptureSessionPresetMedium", referenced from:
      _AVCaptureSessionPresetMedium$non_lazy_ptr in libZXingWidget.a(ZXingWidgetController.o)
     (maybe you meant: _AVCaptureSessionPresetMedium$non_lazy_ptr)
  "_CVPixelBufferGetHeight", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferLockBaseAddress", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_AudioServicesPlaySystemSound", referenced from:
      -[ZXingWidgetController presentResultForString:] in libZXingWidget.a(ZXingWidgetController.o)
  "_AudioServicesCreateSystemSoundID", referenced from:
      -[ZXingWidgetController viewWillAppear:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferUnlockBaseAddress", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferGetBaseAddress", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferGetBytesPerRow", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_iconv_close", referenced from:
      zxing::qrcode::DecodedBitStreamParser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in …
Run Code Online (Sandbox Code Playgroud)

iphone xcode build-process objective-c

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