Author: bryanduxbury
Date: Thu Sep  2 00:29:08 2010
New Revision: 991779

URL: http://svn.apache.org/viewvc?rev=991779&view=rev
Log:
THRIFT-838. cocoa: Generated Cocoa classes have useless @dynamic declarations

This patch removes the @dynamic properties.

Patch: Kevin Ballard

Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc?rev=991779&r1=991778&r2=991779&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc 
(original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_cocoa_generator.cc Thu 
Sep  2 00:29:08 2010
@@ -179,7 +179,6 @@ class t_cocoa_generator : public t_oop_g
   std::string base_type_name(t_base_type* tbase);
   std::string declare_field(t_field* tfield);
   std::string declare_property(t_field* tfield);
-  std::string dynamic_property(t_field* tfield);
   std::string function_signature(t_function* tfunction);
   std::string argument_list(t_struct* tstruct);
   std::string type_to_enum(t_type* ttype);
@@ -717,15 +716,6 @@ void t_cocoa_generator::generate_cocoa_s
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  // @dynamic property declarations
-  if (!members.empty()) {
-    out << "#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_5)" << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      out << indent() << dynamic_property(*m_iter) << endl;
-    }
-    out << "#endif" << endl << endl;
-  }
-
   // initializer with all fields as params
   if (!members.empty()) {
     generate_cocoa_struct_initializer_signature(out, tstruct);
@@ -2335,15 +2325,6 @@ string t_cocoa_generator::declare_proper
 }
 
 /**
- * Add @dynamic declaration for an Objective-C 2.0 property.
- *
- * @param tfield The field for which to declare a dynamic property
- */
-string t_cocoa_generator::dynamic_property(t_field* tfield) {
-  return "@dynamic " + tfield->get_name() + ";";
-}
-
-/**
  * Renders a function signature
  *
  * @param tfunction Function definition


Reply via email to